/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-image: url('assets/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    padding: 10px;
    overflow-y: auto;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.85) 0%, rgba(118, 75, 162, 0.85) 100%);
    z-index: -1;
    backdrop-filter: saturate(0.3);
    -webkit-backdrop-filter: saturate(0.3);
}

.container {
    background: transparent;
    padding: 10px;
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
}

/* Card styling - shared by header, awards, and student lists */
.card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Header with logos */
.header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.header-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

h1 {
    text-align: center;
    color: #333;
    margin: 0;
    font-size: 1.8em;
}

.instructions {
    text-align: center;
    color: white;
    margin-bottom: 15px;
    font-size: 0.95em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Team Information Section */
.team-info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.team-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.team-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.team-number {
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.team-name {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}

.team-info-divider {
    width: 80%;
    height: 2px;
    background: #e0e0e0;
    margin: 20px 0;
}

.team-details {
    text-align: center;
    width: 100%;
}

.team-location {
    /* Take a whole row of the team header, so the location always wraps
       onto its own line below the number and name. */
    flex-basis: 100%;
    text-align: center;
    font-size: 1.1em;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.team-motto {
    font-size: 0.9em;
    color: #888;
    font-style: italic;
    line-height: 1.4;
}

.event-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.event-name {
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    text-align: center;
}

.event-date {
    font-size: 1em;
    color: #666;
    margin-bottom: 5px;
    text-align: center;
}

.event-location {
    font-size: 0.9em;
    color: #888;
    text-align: center;
}

/* Match Status Section */
.match-status-section {
    margin-bottom: 15px;
}

.status-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    padding: 20px;
}

.status-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
}

.status-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.status-record {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #e9ecef;
}

.status-ranking {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #e9ecef;
}

.status-record::before,
.status-ranking::before {
    content: attr(data-label);
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-bottom: 5px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Match Schedule Section */
.match-schedule-section,
.recent-results-section {
    margin-bottom: 15px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.section-header h2 {
    font-size: 1.3em;
    color: #333;
    margin: 0;
}

.last-updated {
    font-size: 0.8em;
    color: #666;
    font-style: italic;
}

.match-list {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    padding: 15px;
    min-height: 100px;
}

.match-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    align-items: center;
    transition: background-color 0.2s ease;
}

.match-item:last-child {
    border-bottom: none;
}

.match-item:hover {
    background-color: #f8f9fa;
}

.match-item.upcoming {
    border-left: 4px solid #28a745;
}

.match-item.played {
    border-left: 4px solid #6c757d;
}

.match-item.winning {
    border-left: 4px solid #ffc107;
}

.match-item.losing {
    border-left: 4px solid #dc3545;
}

.match-time {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
}

.match-type {
    font-size: 0.9em;
    color: #666;
    text-align: center;
    padding: 4px 8px;
    border-radius: 4px;
    background: #e9ecef;
}

.match-type.qual {
    background: #e3f2fd;
    color: #1976d2;
}

.match-type.quarter {
    background: #fff3e0;
    color: #f57c00;
}

.match-type.semifinal {
    background: #fce4ec;
    color: #c2185b;
}

.match-type.final {
    background: #f1f8e9;
    color: #388e3c;
}

.match-teams {
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

.match-score {
    font-size: 1.1em;
    font-weight: bold;
    text-align: right;
}

.match-score.winning {
    color: #28a745;
}

.match-score.losing {
    color: #dc3545;
}

.match-score.tie {
    color: #ffc107;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.empty-state {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}

/* Message styles */
.message {
    text-align: center;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 12px;
    font-size: 1em;
    font-weight: bold;
    display: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.message.show {
    display: block;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* API Status indicator */
.nfc-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}

.nfc-status.connected {
    background-color: #4CAF50;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.5);
}

.nfc-status.disconnected {
    background-color: #f44336;
    box-shadow: 0 0 6px rgba(244, 67, 54, 0.5);
}

/* Responsive design */
@media (max-width: 768px) {
    .team-info-section {
        grid-template-columns: 1fr;
    }
    
    .status-content {
        grid-template-columns: 1fr;
    }
    
    .match-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .match-teams {
        text-align: center;
    }
    
    .match-score {
        text-align: center;
        margin-top: 10px;
    }
}

/* Animation for live updates */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.match-item.live {
    animation: pulse 2s infinite;
}

/* Touch-friendly enhancements */
@media (hover: none) {
    .match-item:hover {
        transform: none;
    }
}