/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2px; /* Reduced from 5px */
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header h1 {
    font-size: 2.2em;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.header h1 i {
    color: #3498db;
    margin-right: 10px;
}

.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.city-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.city-selector label {
    font-weight: 600;
    color: #555;
}

.city-select {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.city-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 20px;
    color: #2c3e50;
    font-weight: 500;
}

.stat-item i {
    color: #3498db;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-message i {
    font-size: 3em;
    color: #3498db;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.welcome-message h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.welcome-message p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.city-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.city-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    hover: scale(1.05);
}

.city-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #3498db;
}

.city-card i {
    font-size: 2em;
    color: #3498db;
    margin-bottom: 10px;
}

.city-card h3 {
    color: #2c3e50;
    margin: 0;
}

/* No Data Message */
.no-data {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.no-data i {
    font-size: 4em;
    color: #95a5a6;
    margin-bottom: 20px;
}

.no-data h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.no-data p {
    color: #666;
    margin-bottom: 25px;
}

/* Controls */
.controls {
    margin-bottom: 20px;
    text-align: center;
}

/* Button Styles */
.btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 0 10px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 8px 25px rgba(149, 165, 166, 0.4);
}

/* Table Container - Full Page */
.table-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px; /* Reduced from 15px */
    padding: 8px; /* Reduced from 15px */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); /* Reduced shadow */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: auto;
    position: relative;
    height: calc(100vh - 20px); /* Reduced from 40px */
    margin: 0;
}

/* Smooth scrolling */
.table-container {
    scroll-behavior: smooth;
}

/* Loading indicator for infinite scroll */
.loading-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: none;
    z-index: 100;
}

.loading-indicator.show {
    display: block;
}

/* Quiz Table */
.quiz-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.quiz-table th,
.quiz-table td {
    border: 1px solid #e0e0e0;
    padding: 4px; /* Reduced from 8px */
    vertical-align: top;
}

.quiz-table th {
    background: rgba(52, 73, 94, 0.95);
    color: white;
    font-weight: 600;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 15;
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #2c3e50;
}

.organizer-cell {
    background: rgba(231, 76, 60, 0.1);
    position: sticky;
    left: 0;
    z-index: 10;
    font-weight: 600;
    color: #c0392b;
    min-width: 40px;
    border-right: 2px solid rgba(231, 76, 60, 0.3);
    backdrop-filter: blur(5px);
    font-size: 0.7em;
}

.organizer-logo {
    height: 16px; /* Small logo size */
    width: auto;
    filter: brightness(0) invert(1); /* Make logo white */
    opacity: 0.9;
}

.date-header {
    min-width: 70px;
    font-size: 0.6em;
    backdrop-filter: blur(10px);
    background: rgba(52, 73, 94, 0.95) !important;
    position: sticky;
    top: 0;
    z-index: 15;
    text-align: center;
    padding: 8px 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.organizer-cell {
    position: sticky;
    left: 0;
    z-index: 10;
    font-weight: 600;
    min-width: 40px;
    backdrop-filter: blur(5px);
    font-size: 0.7em;
}

.quiz-cell {
    width: 70px; /* Reduced from 140px */
    min-height: 30px; /* Reduced from 60px */
    position: relative;
}

/* Quiz Item Styles */
.quiz-item {
    background: white;
    border: 1px solid #e0e0e0; /* Thinner border */
    border-radius: 3px; /* Reduced from 6px */
    padding: 3px; /* Reduced from 6px */
    margin-bottom: 2px; /* Reduced from 4px */
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* Smaller shadow */
}

.quiz-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: #3498db;
}

.quiz-item:last-child {
    margin-bottom: 0;
}



.quiz-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1px; /* Reduced from 2px */
    line-height: 1.1; /* Reduced from 1.2 */
    font-size: 0.6em; /* Reduced from 0.8em */
    display: flex;
    align-items: center;
    gap: 2px; /* Reduced from 4px */
}

.quiz-status-icon {
    font-weight: 700;
    font-size: 0.8em; /* Reduced from 1em */
    color: #e74c3c;
    min-width: 8px; /* Reduced from 12px */
    text-align: center;
}

.quiz-time,
.quiz-place {
    font-size: 0.5em; /* Reduced from 0.7em */
    color: #666;
    margin-bottom: 0px; /* Reduced from 1px */
    display: flex;
    align-items: center;
    gap: 1px; /* Reduced from 3px */
}

.quiz-time i,
.quiz-place i {
    color: #3498db;
    font-size: 0.6em; /* Reduced from 0.8em */
}

/* Seeker Information Styles */
.seeker-info {
    font-size: 0.45em; /* Smaller than quiz-time */
    color: #7f8c8d; /* Grey color for subtle appearance */
    margin-top: 1px;
    display: flex;
    align-items: center;
    gap: 1px;
    padding: 1px 0;
}

.seeker-info i {
    color: #3498db; /* Blue for player seeker */
    font-size: 0.55em;
}

.seeker-info.player-seeker {
    color: #27ae60; /* Green for player seeker */
}

.seeker-info.player-seeker i {
    color: #27ae60; /* Green icon for player seeker */
}

.seeker-info.team-seeker {
    color: #e67e22; /* Orange for team seeker */
}

.seeker-info.team-seeker i {
    color: #e67e22; /* Orange icon for team seeker */
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.4em;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: white;
    transition: color 0.3s ease;
}

.close:hover {
    color: #f1f1f1;
}

.modal-body {
    padding: 25px;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: #666;
}

.loading i {
    color: #3498db;
    margin-right: 10px;
}

/* Quiz Details Styles */
.quiz-details {
    max-height: 500px;
    overflow-y: auto;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.quiz-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.4em;
}

.quiz-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.info-row i {
    color: #3498db;
    font-size: 1.1em;
    margin-top: 2px;
    min-width: 16px;
}

.info-row strong {
    color: #2c3e50;
    min-width: 100px;
    margin-right: 8px;
}

.info-row span {
    color: #555;
    flex: 1;
}

.description {
    flex-direction: column;
    align-items: flex-start;
}

.description-text {
    margin-top: 8px;
    line-height: 1.5;
    color: #555;
    width: 100%;
}

.quiz-link {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.quiz-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

.error {
    text-align: center;
    padding: 40px;
    color: #e74c3c;
}

.error i {
    font-size: 2em;
    margin-bottom: 15px;
    color: #e74c3c;
}

.error p {
    margin: 0;
    font-size: 1.1em;
}

/* Today column highlighting */
/* Removed today column highlighting styles */

/* Weekend highlighting */
.date-header.weekend,
.quiz-cell.weekend {
    background: rgba(231, 76, 60, 0.1) !important; /* Red highlight for weekends */
}

.date-header.weekend {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
    color: white !important;
}

/* Cell highlighting for row/column selection */
.highlighted-row {
    background: rgba(52, 152, 219, 0.1) !important; /* Blue highlight for rows (same as columns) */
}

.highlighted-column {
    background: rgba(52, 152, 219, 0.1) !important; /* Blue highlight for columns */
}

.highlighted-cell {
    background: rgba(52, 152, 219, 0.1) !important; /* Blue highlight for the specific cell (same as row/column) */
    border-radius: 4px;
}

/* Hide empty rows functionality */
.organizer-row[style*="display: none"] {
    display: none !important;
}

/* Team-up section styles */
.team-up-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
}

.team-up-section h4 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.1em;
}

.team-up-section h4 i {
    margin-right: 8px;
    color: #3498db;
}

.team-up-list {
    margin-top: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.team-up-link {
    color: #3498db;
    text-decoration: none;
    background: rgba(52, 152, 219, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.team-up-link:hover {
    background: rgba(52, 152, 219, 0.2);
    color: #2980b9;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        padding: 15px;
    }
    
    .quiz-table {
        min-width: 600px;
    }
    
    .date-header,
    .quiz-cell {
        min-width: 60px; /* Reduced from 120px */
        width: 60px;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }
    
    .header-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats {
        justify-content: center;
    }
    
    .city-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .btn {
        margin: 5px;
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .table-container {
        height: calc(100vh - 15px); /* Reduced from 30px */
        padding: 5px; /* Reduced from 10px */
    }
    
    .organizer-cell {
        min-width: 35px; /* Reduced from 50px */
    }
    
    .date-header,
    .quiz-cell {
        min-width: 55px; /* Reduced from 110px */
        width: 55px;
    }
    
    .quiz-item {
        padding: 2px; /* Reduced from 5px */
    }
    
    .quiz-name {
        font-size: 0.5em; /* Reduced from 0.75em */
    }
    
    .quiz-time,
    .quiz-place {
        font-size: 0.45em; /* Reduced from 0.65em */
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .welcome-message,
    .no-data {
        padding: 30px 20px;
    }
    
    .table-container {
        padding: 4px; /* Reduced from 8px */
        height: calc(100vh - 10px); /* Reduced from 20px */
    }
    
    .organizer-cell {
        min-width: 30px; /* Reduced from 40px */
    }
    
    .date-header,
    .quiz-cell {
        min-width: 45px; /* Reduced from 90px */
        width: 45px;
    }
}
