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

body {
    font-family: 'VT323', monospace;
    background: #f8f9fa;
    color: #2c3e50;
    min-height: 100vh;
    padding: 20px;
    font-size: 22px;
    line-height: 1.5;
}

.terminal {
    max-width: 1000px;
    margin: 0 auto;
    background: #ffffff;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.terminal-header {
    background: #e9ecef;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-header h1 {
    font-size: 28px;
    color: #2c3e50;
    text-shadow: none;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.control.red { background: #dc3545; }
.control.yellow { background: #ffc107; }
.control.green { background: #28a745; }

.terminal-body {
    padding: 20px;
}

.prompt-line {
    margin-bottom: 20px;
    font-size: 16px;
}

.prompt {
    color: #007bff;
    margin-right: 8px;
}

#current-status {
    color: #28a745;
}

.section {
    margin-bottom: 30px;
}

.section h2 {
    font-size: 24px;
    color: #007bff;
    margin-bottom: 10px;
    text-shadow: none;
}

.separator {
    color: #6c757d;
    margin-bottom: 15px;
    font-size: 16px;
}

.form-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: center;
    gap: 15px;
}

label {
    color: #495057;
    font-size: 18px;
    font-weight: 500;
}

input, select {
    background: #ffffff;
    border: 1px solid #ced4da;
    color: #495057;
    padding: 10px 14px;
    font-family: 'VT323', monospace;
    font-size: 18px;
    border-radius: 4px;
    outline: none;
    transition: all 0.3s ease;
}

input:focus, select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

input::placeholder {
    color: #6c757d;
}

select option {
    background: #ffffff;
    color: #495057;
}

button {
    background: #007bff;
    border: 2px solid #007bff;
    color: #ffffff;
    padding: 14px 28px;
    font-family: 'VT323', monospace;
    font-size: 20px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    grid-column: 1 / -1;
    justify-self: start;
}

button:hover {
    background: #0056b3;
    border-color: #0056b3;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

button:active {
    transform: translateY(1px);
}

.matches-container {
    min-height: 100px;
}

.match-group {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #28a745;
    transition: all 0.3s ease;
}

.match-group.current-user-match {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    border-left: 4px solid #1976d2;
    box-shadow: 0 3px 12px rgba(33, 150, 243, 0.2);
}

.match-group:hover {
    background: #e9ecef;
    border-left-color: #ffc107;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.match-time {
    color: #007bff;
    font-size: 22px;
    font-weight: bold;
}

.match-details {
    display: flex;
    gap: 20px;
    color: #6c757d;
    font-size: 18px;
    flex-wrap: wrap;
}

.player-count {
    color: #fd7e14;
    font-weight: 500;
}

.full-group {
    color: #28a745;
    font-weight: bold;
}

.avg-rating {
    color: #e83e8c;
    font-weight: 500;
}

.players-list {
    margin-top: 10px;
    padding-left: 20px;
}

.player-item {
    color: #6c757d;
    font-size: 16px;
    margin-bottom: 5px;
}

.player-item.current-user-player {
    color: #1976d2;
    font-weight: bold;
    background: rgba(33, 150, 243, 0.1);
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: -8px;
}

.current-user-indicator {
    color: #1976d2;
    font-weight: bold;
    background: rgba(33, 150, 243, 0.1);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 16px;
}

.loading-message {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
    font-size: 18px;
}

.empty-message {
    color: #6c757d;
    text-align: center;
    padding: 20px;
    font-style: italic;
    font-size: 18px;
}

.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lang-btn {
    background: transparent;
    border: 1px solid #ced4da;
    color: #6c757d;
    padding: 6px 12px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.lang-btn:hover {
    border-color: #007bff;
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    box-shadow: none;
    transform: none;
}

.lang-btn.active {
    border-color: #007bff;
    color: #007bff;
    background: rgba(0, 123, 255, 0.15);
    font-weight: 500;
}

.error-message {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 12px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 16px;
}

.success-message {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid #28a745;
    color: #28a745;
    padding: 12px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 16px;
}

/* New styles for clickable matches and improved display */
.match-group.clickable {
    cursor: pointer;
}

.match-group.clickable:hover {
    background: #e3f2fd;
    border-left-color: #2196f3;
}

.needs-players {
    color: #ff6b35;
    font-weight: 600;
}

.join-hint {
    color: #28a745;
    font-style: italic;
    font-size: 14px;
}

.players-list {
    margin-top: 12px;
    padding-left: 20px;
    border-top: 1px solid #e9ecef;
    padding-top: 10px;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        font-size: 18px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .match-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .match-details {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .language-selector {
        position: static;
        margin-top: 20px;
        justify-content: center;
    }
    
    .terminal-header h1 {
        font-size: 24px;
    }
    
    .section h2 {
        font-size: 20px;
    }
    
    .match-time {
        font-size: 18px;
    }
    
    .match-details {
        font-size: 16px;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .filter-btn {
        flex: 1;
        min-width: 80px;
    }
    
    #system-description {
        font-size: 16px;
    }
}

/* Admin mode styles */
.terminal.admin-mode {
    border-color: #e74c3c;
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.2);
}

.terminal.admin-mode .terminal-header {
    background: #ffebee;
    border-bottom-color: #e74c3c;
}

.terminal.admin-mode .terminal-header h1::after {
    content: ' [ADMIN MODE]';
    color: #e74c3c;
    font-size: 16px;
    font-weight: normal;
}

.match-controls {
    margin-left: 10px;
    display: inline-flex;
    gap: 5px;
}

.edit-btn, .delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.3s ease;
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    grid-column: auto;
    justify-self: auto;
}

.edit-btn:hover {
    background: rgba(0, 123, 255, 0.1);
    transform: scale(1.1);
}

.delete-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    transform: scale(1.1);
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #ffffff;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    font-family: 'VT323', monospace;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    color: #007bff;
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.modal-buttons button {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid;
    font-family: 'VT323', monospace;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    grid-column: auto;
    justify-self: auto;
}

.modal-buttons button[type="submit"] {
    background: #28a745;
    border-color: #28a745;
    color: #ffffff;
}

.modal-buttons button[type="submit"]:hover {
    background: #218838;
    border-color: #218838;
}

.modal-buttons button[type="button"] {
    background: #6c757d;
    border-color: #6c757d;
    color: #ffffff;
}

.modal-buttons button[type="button"]:hover {
    background: #545b62;
    border-color: #545b62;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .match-controls {
        margin-left: 5px;
        flex-direction: column;
        gap: 2px;
    }
    
    .edit-btn, .delete-btn {
        font-size: 14px;
    }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.cursor::after {
    content: '█';
    animation: blink 1s infinite;
    color: #007bff;
}

.typing-animation {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 2s steps(20, end);
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

.demo-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.demo-btn {
    background: #6c757d;
    border: 1px solid #6c757d;
    color: #ffffff;
    padding: 8px 14px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0;
    grid-column: auto;
    justify-self: auto;
    min-width: 90px;
}

.demo-btn:hover {
    background: #545b62;
    border-color: #545b62;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: none;
}

.demo-btn:active {
    transform: translateY(1px);
}

.filter-section {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.search-section {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.search-section h3 {
    color: #495057;
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 500;
}

.search-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

#search-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: 'VT323', monospace;
    font-size: 18px;
    background: #ffffff;
    transition: border-color 0.3s ease;
}

#search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.search-btn, .clear-search-btn {
    padding: 8px 16px;
    border: 1px solid #007bff;
    background: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 18px;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.clear-search-btn {
    background: #6c757d;
    border-color: #6c757d;
}

.clear-search-btn:hover {
    background: #545b62;
    border-color: #545b62;
}

.theme-btn {
    background: #6c757d;
    border: 1px solid #6c757d;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 16px;
    margin-left: 5px;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    background: #545b62;
    border-color: #545b62;
}

/* Dark Theme Styles */
body.dark-theme {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-theme .terminal {
    background: #2d2d2d;
    border-color: #404040;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-theme .terminal-header {
    background: #404040;
    border-bottom-color: #555;
    color: #e0e0e0;
}

body.dark-theme .terminal-header h1 {
    color: #e0e0e0;
}

body.dark-theme .match-group {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-theme .match-group:hover {
    background: #454545;
    border-left-color: #ffc107;
}

body.dark-theme .match-group.current-user-match {
    background: #1a2332;
    border-color: #2196f3;
    border-left-color: #1976d2;
    box-shadow: 0 3px 12px rgba(33, 150, 243, 0.3);
}

body.dark-theme .match-time {
    color: #4fc3f7;
}

body.dark-theme .match-details {
    color: #b0b0b0;
}

body.dark-theme .player-count {
    color: #ff8a65;
}

body.dark-theme .full-group {
    color: #66bb6a;
}

body.dark-theme .avg-rating {
    color: #f06292;
}

body.dark-theme .player-item {
    color: #b0b0b0;
}

body.dark-theme .player-item.current-user-player {
    color: #4fc3f7;
    background: rgba(33, 150, 243, 0.2);
}

body.dark-theme .current-user-indicator {
    color: #4fc3f7;
    background: rgba(33, 150, 243, 0.2);
}

body.dark-theme .filter-section,
body.dark-theme .search-section {
    background: #3a3a3a;
    border-color: #555;
}

body.dark-theme .filter-section h3,
body.dark-theme .search-section h3 {
    color: #e0e0e0;
}

body.dark-theme .filter-btn {
    background: #555;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-theme .filter-btn:hover {
    background: #666;
    border-color: #666;
}

body.dark-theme .filter-btn.active {
    background: #007bff;
    border-color: #007bff;
}

body.dark-theme #search-input {
    background: #555;
    border-color: #666;
    color: #e0e0e0;
}

body.dark-theme #search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

body.dark-theme .search-btn {
    background: #007bff;
    border-color: #007bff;
}

body.dark-theme .search-btn:hover {
    background: #0056b3;
    border-color: #0056b3;
}

body.dark-theme .clear-search-btn {
    background: #6c757d;
    border-color: #6c757d;
}

body.dark-theme .clear-search-btn:hover {
    background: #545b62;
    border-color: #545b62;
}

body.dark-theme .language-selector {
    background: rgba(45, 45, 45, 0.95);
    border-color: #555;
}

body.dark-theme .lang-btn {
    background: #555;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-theme .lang-btn:hover {
    background: #666;
    border-color: #666;
}

body.dark-theme .lang-btn.active {
    background: #007bff;
    border-color: #007bff;
}

body.dark-theme .demo-btn {
    background: #6c757d;
    border-color: #6c757d;
    color: #e0e0e0;
}

body.dark-theme .demo-btn:hover {
    background: #545b62;
    border-color: #545b62;
}

body.dark-theme .form-grid input,
body.dark-theme .form-grid select {
    background: #555;
    border-color: #666;
    color: #e0e0e0;
}

body.dark-theme .form-grid input:focus,
body.dark-theme .form-grid select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

body.dark-theme .form-grid label {
    color: #e0e0e0;
}

body.dark-theme .form-grid button {
    background: #28a745;
    border-color: #28a745;
}

body.dark-theme .form-grid button:hover {
    background: #218838;
    border-color: #1e7e34;
}

body.dark-theme .separator {
    color: #666;
}

body.dark-theme .prompt {
    color: #66bb6a;
}

body.dark-theme .empty-message,
body.dark-theme .loading-message {
    color: #b0b0b0;
}

body.dark-theme .theme-btn {
    background: #ffc107;
    border-color: #ffc107;
    color: #000;
}

body.dark-theme .theme-btn:hover {
    background: #e0a800;
    border-color: #d39e00;
}

.filter-section h3 {
    font-size: 18px;
    color: #495057;
    margin-bottom: 10px;
    font-weight: 500;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background: #ffffff;
    border: 1px solid #ced4da;
    color: #6c757d;
    padding: 8px 16px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0;
}

.filter-btn:hover {
    border-color: #007bff;
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    transform: none;
}

.filter-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: #ffffff;
    font-weight: 500;
}

.system-info {
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(40, 167, 69, 0.1);
    border-left: 4px solid #28a745;
    border-radius: 3px;
}

#system-description {
    color: #155724;
    font-size: 18px;
    line-height: 1.4;
}

.days-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.day-presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.preset-btn {
    background: #e9ecef;
    border: 1px solid #ced4da;
    color: #495057;
    padding: 6px 12px;
    font-family: 'VT323', monospace;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0;
}

.preset-btn:hover {
    background: #007bff;
    border-color: #007bff;
    color: #ffffff;
    transform: none;
}

.preset-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: #ffffff;
    font-weight: 500;
}

.day-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: #ffffff;
}

.checkbox-label:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2);
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: #007bff;
    font-weight: 500;
}

.checkbox-label:has(input:checked) {
    background: rgba(0, 123, 255, 0.1);
    border-color: #007bff;
}

/* Admin Panel Styles */
.admin-panel {
    background: #f8f9fa;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.1);
}

.admin-panel h3 {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 24px;
}

.admin-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.admin-search {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-search input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'VT323', monospace;
    font-size: 18px;
    min-width: 200px;
}

.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-btn {
    padding: 8px 15px;
    border: 1px solid #6c757d;
    background: #6c757d;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 16px;
    transition: all 0.2s;
}

.admin-btn:hover {
    background: #5a6268;
    border-color: #5a6268;
}

.admin-btn.danger {
    background: #dc3545;
    border-color: #dc3545;
}

.admin-btn.danger:hover {
    background: #c82333;
    border-color: #c82333;
}

.admin-btn.small {
    padding: 4px 8px;
    font-size: 14px;
}

.admin-results {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.admin-matches-list,
.admin-stats-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-match-item,
.admin-stats-item {
    background: #f8f9fa;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.admin-match-info {
    flex: 1;
    font-size: 16px;
    line-height: 1.6;
}

.admin-match-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.admin-message {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

@media (max-width: 768px) {
    .demo-controls {
        position: static;
        flex-direction: row;
        justify-content: center;
        margin-top: 20px;
        width: 100%;
    }
    
    .demo-btn {
        flex: 1;
        min-width: auto;
    }
    
    /* Admin responsive styles */
    .admin-controls {
        flex-direction: column;
    }
    
    .admin-search,
    .admin-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .admin-search input {
        min-width: 100%;
    }
    
    .admin-match-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .admin-match-actions {
        align-self: flex-start;
    }
}