* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
    position: relative;
}

.controls {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    pointer-events: none;
}

.controls > * {
    pointer-events: auto;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    padding: 0;
    background-color: #e0e0e0;
    color: #333;
    border: 2px solid #ccc;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background-color: #d0d0d0;
}

.colorblind-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 1000;
}

.colorblind-toggle:hover {
    background-color: #1976D2;
}

.manage-toggle {
    position: fixed;
    top: 20px;
    right: 200px;
    padding: 10px 20px;
    background-color: #9C27B0;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 1000;
}

.manage-toggle:hover {
    background-color: #7B1FA2;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    margin-bottom: 5px;
    color: #333;
}

.subtitle {
    margin-top: 0;
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

#search {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.3s ease;
}

#search:focus {
    border-color: #4CAF50;
}

.console-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.console-item.grouped {
    padding-left: 40px;
    background-color: #fafafa;
}

.console-item:last-child {
    border-bottom: none;
}

.console-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.name-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.group-header {
    padding: 12px 15px;
    background-color: #e3f2fd;
    font-weight: bold;
    color: #1976D2;
    border-bottom: 2px solid #2196F3;
    margin-top: 10px;
}

.name-input {
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 3px;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
}

.name-input:focus {
    outline: none;
    border-color: #2196F3;
}

.short-input {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    width: 100%;
    color: #666;
}

.short-input:focus {
    outline: none;
    border-color: #2196F3;
}

.group-input {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    width: 200px;
}

.group-input:focus {
    outline: none;
    border-color: #2196F3;
}

.console-name {
    font-size: 18px;
    color: #333;
}

.toggle-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.toggle-btn:disabled {
    cursor: default;
}

.toggle-btn.buy {
    background-color: #4CAF50;
    color: white;
}

.toggle-btn.no-buy {
    background-color: #f44336;
    color: white;
}

.toggle-btn.caution {
    background-color: #FFC107;
    color: #333;
}

.toggle-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.note-container {
    margin-top: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.note-input {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.note-text {
    font-size: 14px;
    color: #666;
    white-space: pre-wrap;
}

/* Management Panel */
.management-panel {
    background-color: #f0f7ff;
    border: 2px solid #2196F3;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    position: sticky;
    top: 20px;
    z-index: 100;
}

.management-panel h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2196F3;
    font-size: 20px;
}

.add-console-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.add-console-form input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.add-console-form button {
    padding: 10px 20px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.add-console-form button:hover {
    background-color: #1976D2;
}

/* Autocomplete styles */
.autocomplete-container {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 2px solid #2196F3;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: #E3F2FD;
}

.autocomplete-item.selected {
    font-weight: bold;
}

.button-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.edit-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    background-color: #FF9800;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.edit-btn:hover {
    background-color: #F57C00;
    transform: scale(1.1);
}

.delete-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.delete-btn:hover {
    background-color: #d32f2f;
    transform: scale(1.1);
}

body.colorblind-mode .edit-btn {
    background-color: #FFA726;
}

body.colorblind-mode .edit-btn:hover {
    background-color: #FB8C00;
}

body.colorblind-mode .delete-btn {
    background-color: #D32F2F;
}

body.colorblind-mode .delete-btn:hover {
    background-color: #B71C1C;
}

/* Colorblind mode - blue/orange instead of green/red */
body.colorblind-mode .toggle-btn.buy {
    background-color: #2196F3;
}

body.colorblind-mode .toggle-btn.no-buy {
    background-color: #FF9800;
}

body.colorblind-mode .toggle-btn.caution {
    background-color: #9C27B0;
    color: white;
}

body.colorblind-mode #search:focus {
    border-color: #2196F3;
}

/* Loading skeleton styles */
.skeleton-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.skeleton-name {
    height: 20px;
    width: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-button {
    height: 32px;
    width: 100px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 5px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Password Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    max-width: 400px;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

.modal-content input[type="password"],
.modal-content input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.modal-content input[type="password"]:focus,
.modal-content input[type="text"]:focus {
    outline: none;
    border-color: #2196F3;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.modal-btn.primary {
    background-color: #2196F3;
    color: white;
}

.modal-btn.primary:hover {
    background-color: #1976D2;
}

.modal-btn:not(.primary) {
    background-color: #ddd;
    color: #333;
}

.modal-btn:not(.primary):hover {
    background-color: #ccc;
}

.password-error {
    color: #f44336;
    font-size: 14px;
    margin-top: 10px;
}

/* Dark Mode */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .container {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode h1,
body.dark-mode h2 {
    color: #e0e0e0;
}

body.dark-mode .subtitle {
    color: #999;
}

body.dark-mode .console-item {
    border-bottom-color: #444;
}

body.dark-mode .console-item.grouped {
    background-color: #252525;
}

body.dark-mode .console-name {
    color: #e0e0e0;
}

body.dark-mode #search,
body.dark-mode .modal-content input {
    background-color: #3d3d3d;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .group-header {
    background-color: #1e3a5f;
    color: #64B5F6;
    border-bottom-color: #2196F3;
}

body.dark-mode .management-panel {
    background-color: #1e2a3a;
    border-color: #2196F3;
}

body.dark-mode .modal-content {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .note-container {
    background-color: #252525;
}

body.dark-mode .note-input {
    background-color: #3d3d3d;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .note-text {
    color: #b0b0b0;
}

/* Gorilla Mode */
body.gorilla-mode {
    background-color: #ff1493;
    color: #00ff00;
}

body.gorilla-mode .container {
    background-color: #00ff00;
    color: #ff1493;
}

body.gorilla-mode h1,
body.gorilla-mode h2 {
    color: #ff1493;
}

body.gorilla-mode .subtitle {
    color: #ff69b4;
}

body.gorilla-mode .console-item {
    border-bottom-color: #ff69b4;
}

body.gorilla-mode .console-item.grouped {
    background-color: #98fb98;
}

body.gorilla-mode .console-name {
    color: #ff1493;
}

body.gorilla-mode #search,
body.gorilla-mode .modal-content input {
    background-color: #98fb98;
    border-color: #ff69b4;
    color: #ff1493;
}

body.gorilla-mode .group-header {
    background-color: #ff69b4;
    color: #00ff00;
    border-bottom-color: #ff1493;
}

body.gorilla-mode .management-panel {
    background-color: #98fb98;
    border-color: #ff1493;
}

body.gorilla-mode .modal-content {
    background-color: #00ff00;
    color: #ff1493;
}

body.gorilla-mode .note-container {
    background-color: #98fb98;
}

body.gorilla-mode .note-input {
    background-color: #98fb98;
    border-color: #ff69b4;
    color: #ff1493;
}

body.gorilla-mode .note-text {
    color: #ff1493;
}

body.gorilla-mode .toggle-btn.buy {
    background-color: #ff1493;
    color: #00ff00;
}

body.gorilla-mode .toggle-btn.no-buy {
    background-color: #00ff00;
    color: #ff1493;
}

body.gorilla-mode .toggle-btn.caution {
    background-color: #ffa500;
    color: #000;
}
