/* 
* Global Styles for Tennis Pyramid Platform
* Current Date and Time (UTC): 2025-08-12 18:47:45
* Current User's Login: tadas12587
*/

/* ========== ROOT VARIABLES ========== */
:root {
    /* Primary colors */
    --primary: #1976D2;
    --primary-dark: #1565C0;
    --primary-light: #e3f2fd;
    
    /* Secondary colors */
    --secondary: #FF9800;
    --secondary-dark: #F57C00;
    --secondary-light: #fff3e0;
    
    /* Success colors */
    --success: #4CAF50;
    --success-dark: #43A047;
    --success-light: #e8f5e9;
    
    /* Error/Warning colors */
    --error: #F44336;
    --error-light: #ffebee;
    
    /* Text colors */
    --text-primary: #333333;
    --text-secondary: #757575;
    --text-light: #FFFFFF;
    
    /* Layout colors */
    --surface: #FFFFFF;
    --background: #F5F7FA;
    --border-color: #E0E0E0;
    
    /* Effects */
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
    
    /* Challenge specific */
    --challenger-bg: #f5f5f5; /* Light grey background for challenger team */
    --defender-bg: #f5f5f5;   /* Light grey background for defender team */
    --winner-bg: #E6F4EA;     /* Light green background for winner */
    --winner-score: #388e3c;  /* Green text for winning score */
    --round-badge-bg: #303F9F;
    
    /* Status colors */
    --status-active: #2e7d32;
    --status-injured: #c62828;
    --status-challenged: #f57c00;
    --status-invulnerable: #1565c0;
    --status-cooldown: #6a1b9a;
    --status-tech-loss: #7b1fa2;
    --status-unpaid: #757575;
}

/* ========== BASE STYLES ========== */
body {
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3px;
}

/* ========== CARD COMPONENTS ========== */
.card {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--primary);
}

.card-body {
    padding: 3px;
}

/* ========== GRID LAYOUTS ========== */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.challenge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.group-header {
    grid-column: 1 / -1;
    background-color: #f5f5f5;
    padding: 8px 12px;
    font-weight: 500;
    font-size: 14px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.group-header.top {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.group-header.mid {
    background-color: var(--secondary-light);
    color: var(--secondary-dark);
}

.group-header.low {
    background-color: var(--error-light);
    color: var(--error);
}

/* ========== PLAYER CARD STYLES ========== */
.player-card {
    background: var(--surface);
    border-radius: 6px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid var(--border-color);
    padding: 12px;
    display: flex;
    align-items: center;
}

.player-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--hover-shadow);
}

.player-position {
    background: var(--primary);
    color: var(--text-light);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    margin-right: -5px;
    flex-shrink: 0;
    z-index: 1;
}

.player-avatar {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 18px;
    color: var(--text-light);
    overflow: hidden;
    flex-shrink: 0;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-info {
    flex: 1;
    margin-left: 10px;
    display: flex;
    flex-direction: column;
}

.player-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 4px;
    line-height: 1.2;
}

.player-name:hover {
    text-decoration: underline;
    color: var(--primary);
}

.player-status {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.player-status .status-badge {
    margin-bottom: 4px;
}

/* ========== BADGES & LABELS ========== */
/* Common badge styles */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 8px;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 200;
    text-decoration: none;
}

.status-badge:hover {
    opacity: 0.9;
    cursor: pointer;
}

.status-active {
    background-color: #e8f5e900;
    color: var(--status-active);
}

.status-injured {
    background-color: #ffebee00;
    color: var(--status-injured);
}

.status-challenged {
    background-color: #fff3e000;
    color: var(--status-challenged);
}

.status-invulnerable {
    background-color: #e3f2fd00;
    color: var(--status-invulnerable);
}

.status-cooldown {
    background-color: #f3e5f500;
    color: var(--status-cooldown);
}

.status-tech_loss {
    background-color: #ffebee00;
    color: var(--status-tech-loss);
}

.status-unpaid {
    background-color: #f5f5f5;
    color: var(--status-unpaid);
}

.status-until {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: 4px;
}

/* Change badges */
.change-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    margin-right: 8px;
}

.change-positive {
    background-color: var(--success-light);
    color: var(--status-active);
}

.change-negative {
    background-color: var(--error-light);
    color: var(--status-injured);
}

/* Badge colors */
.badge-success { background-color: var(--success-light); color: var(--status-active); }
.badge-primary { background-color: var(--primary-light); color: var(--primary); }
.badge-warning { background-color: var(--secondary-light); color: var(--secondary-dark); }

/* Challenge ID badge */
.calendar-badge {
    position: absolute;
    top: 80%; 
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--round-badge-bg);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    z-index: 2;
    cursor: pointer;
    white-space: nowrap;
}

/* Challenge ID - positioned at top 20% */
.challenge-id {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    z-index: 2;
}

.calendar-badge:hover {
    opacity: 0.9;
}

/* City badge */
.city-badge {
    background-color: #e8eaf6;
    color: #303f9f;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

/* Position changes */
.position-movement {
    color: var(--text-secondary);
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
}

.current-position {
    padding: 2px 6px;
    background-color: var(--primary-light);
    border-radius: 4px;
    font-weight: bold;
    color: var(--primary-dark);
}

.position-changes {
    display: flex;
    align-items: center;
    margin-top: 4px;
    font-size: 11px;
}

/* ========== BUTTON STYLES ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--text-light);
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
}

.btn-success {
    background-color: var(--success);
    color: var(--text-light);
}

.btn-success:hover {
    background-color: var(--success-dark);
}

.btn-danger {
    background-color: var(--error);
    color: var(--text-light);
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-outline {
    background-color: #303f9f;
    color: #ffffff;
}

.btn-outline:hover {
    background-color: #303f9fc2;
}

.btn-sm {
    padding: 3px 8px;
    font-size: 12px;
    border-radius: 3px;
}

.btn-icon {
    padding: 6px;
    min-width: 32px;
    min-height: 32px;
}

.btn-disabled {
    background-color: #e0e0e0 !important;
    color: #9e9e9e !important;
    cursor: not-allowed;
}

.btn-warning {
    background: var(--secondary);
    color: var(--text-light);
}

.btn-warning:hover {
    background: var(--secondary-dark);
}

/* Toggle buttons - unified */
.toggle-filters, .toggle-button {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-filters:hover, .toggle-button:hover {
    background: rgba(25, 118, 210, 0.1);
}

/* Back button */
.back-button {
    text-align: center;
    margin: 20px 0;
}

/* ========== FILTER STYLES ========== */
.filters {
    display: none;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filters.active {
    display: flex;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
}

.filter-input {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
}

select.filter-input {
    background-color: var(--surface);
    cursor: pointer;
}

/* Search input */
.search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    max-width: 250px;
}

/* ========== MATCH/CHALLENGE STYLES ========== */
.match-card {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background: var(--surface);
    position: relative;
    text-decoration: none;
    min-height: 200px; /* Ensure minimum height for proper positioning */
}

.match-teams {
    display: flex;
    position: relative;
}

.team-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    position: relative;
    background-color: var(--surface);
}

.team-challenger {
    background-color: var(--challenger-bg);
}

.team-defender {
    background-color: var(--defender-bg);
}

.team-winner {
    background-color: var(--winner-bg);
}

.match-card .player {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
}

.match-card .player-avatar {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 18px;
    color: var(--text-light);
    overflow: hidden;
    margin-bottom: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.match-card .player-name {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    color: var(--text-primary);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.score-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface);
    border-radius: 4px;
    padding: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1;
}

.score-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2px 0;
}

.score {
    font-weight: bold;
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.score-team1-win {
    color: var(--winner-score);
}

.score-team2-win {
    color: var(--winner-score);
}

.score-separator {
    margin: 0 5px;
    color: #999;
}

.match-footer {
    padding: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    border-top: 1px solid var(--border-color);
}

/* Match tournament - scheduled time/planned block */
.match-tournament {
    font-size: 12px;
    padding: 6px 8px;
    text-align: center;
    font-weight: 500;
}

/* Status-specific colors for match-tournament - matching status-bar colors */
.match-tournament.waiting {
    background-color: #FF9800; /* Vibrant orange for "Waiting for response" */
    color: white;
}

.match-tournament.pending {
    background-color: #FF9800; /* Vibrant orange for "Waiting for response" */
    color: white;
}

.match-tournament.completed {
    background-color: #388e3c; /* Green for "Completed" */
    color: white;
}

.match-tournament.disputed {
    background-color: #ff7043; /* Deep orange for "Disputed" */
    color: white;
}

.match-tournament.cancelled {
    background-color: #757575; /* Gray for "Cancelled" */
    color: white;
}

.match-tournament.technical {
    background-color: #e53935; /* Red for "Technical loss" */
    color: white;
}

.match-tournament.loss {
    background-color: #d32f2f; /* Red for losses */
    color: white;
}

.match-tournament.default {
    background-color: #333; /* Dark gray for default */
    color: white;
}

.match-tournament.inprogress {
    background-color: #303F9F; /* Purple for "In progress" */
    color: white;
}

/* Status-specific colors for match-footer - matching status-bar colors */
.match-footer.waiting {
    background-color: #FF9800; /* Vibrant orange for "Waiting for response" */
    color: white;
}

.match-footer.pending {
    background-color: #FF9800; /* Vibrant orange for "Waiting for response" */
    color: white;
}

.match-footer.completed {
    background-color: #388e3c; /* Green for "Completed" */
    color: white;
}

.match-footer.disputed {
    background-color: #ff7043; /* Deep orange for "Disputed" */
    color: white;
}

.match-footer.cancelled {
    background-color: #757575; /* Gray for "Cancelled" */
    color: white;
}

.match-footer.technical {
    background-color: #e53935; /* Red for "Technical loss" */
    color: white;
}

.match-footer.default {
    background-color: #333; /* Dark gray for default */
    color: white;
}

.match-footer.inprogress {
    background-color: #303F9F; /* Purple for "In progress" */
    color: white;
}

/* Calendar button styles */
.match-calendar {
    padding: 8px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background-color: #f9f9f9;
}

.calendar-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
}

.calendar-btn:hover {
    background-color: #45a049;
}

.calendar-btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Challenge block styles */
.challenge-block {
    margin-bottom: 16px;
}

.challenge-status {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 12px;
}

.challenge-teams {
    margin-bottom: 12px;
}

.team {
    margin-bottom: 6px;
}

.challenge-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* Challenge links */
.challenge-link {
    color: var(--primary);
    text-decoration: none;
}

.challenge-link:hover {
    text-decoration: underline;
}

/* Challenge status styles */
.status-waiting { color: #fbc02d; }
.status-inprogress { color: var(--primary); }
.status-completed { color: var(--success); }
.status-disputed { color: #ff7043; }
.status-pending { color: #0288d1; }
.status-pending-result { color: #0288d1; }
.status-cancelled { color: var(--text-secondary); }
.status-technical { color: var(--error); }
.status-default { color: var(--text-primary); }
.status-confirmed { color: var(--success-dark); }

/* Status bar styles */
.status-bar {
    padding: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    width: 100%;
}

.status-bar.waiting {
    background-color: #FF9800; /* Vibrant orange for "Waiting for response" */
    color: white;
}

.status-bar.pending {
    background-color: #FF9800; /* Vibrant orange for "Waiting for response" */
    color: white;
}

.status-bar.inprogress {
    background-color: #303F9F; /* Purple for "In progress" */
    color: white;
}

.status-bar.completed {
    background-color: #388e3c; /* Green for "Completed" */
    color: white;
}

.status-bar.disputed {
    background-color: #ff7043; /* Deep orange for "Disputed" */
    color: white;
}

.status-bar.cancelled {
    background-color: #757575; /* Gray for "Cancelled" */
    color: white;
}

.status-bar.technical {
    background-color: #e53935; /* Red for "Technical loss" */
    color: white;
}

.status-bar.loss {
    background-color: #d32f2f; /* Red for losses */
    color: white;
}

.status-bar.default {
    background-color: #333; /* Dark gray for default */
    color: white;
}

/* Challenge ID status colors */
.challenge-id.waiting,
.challenge-id-display.waiting {
    background-color: #FF9800; /* Vibrant orange for "Waiting for response" */
    color: white;
}

.challenge-id.pending,
.challenge-id-display.pending {
    background-color: #FF9800; /* Vibrant orange for "Waiting for response" */
    color: white;
}

.challenge-id.completed,
.challenge-id-display.completed {
    background-color: #388e3c; /* Green for "Completed" */
    color: white;
}

.challenge-id.disputed,
.challenge-id-display.disputed {
    background-color: #ff7043; /* Deep orange for "Disputed" */
    color: white;
}

.challenge-id.cancelled,
.challenge-id-display.cancelled {
    background-color: #757575; /* Gray for "Cancelled" */
    color: white;
}

.challenge-id.technical,
.challenge-id-display.technical {
    background-color: #e53935; /* Red for "Technical loss" */
    color: white;
}

.challenge-id.loss,
.challenge-id-display.loss {
    background-color: #d32f2f; /* Red for losses */
    color: white;
}

.challenge-id.default,
.challenge-id-display.default {
    background-color: #333; /* Dark gray for default */
    color: white;
}

.challenge-id.inprogress,
.challenge-id-display.inprogress {
    background-color: #303F9F; /* Purple for "In progress" */
    color: white;
}

/* ========== NOTIFICATION STYLES ========== */
.notification {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.notification-warning {
    background-color: #f9f9f9;
    color: #333333;
}

.notification-info {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

/* No results message */
.no-results {
    text-align: center;
    padding: 20px;
    font-size: 16px;
    color: #666;
    background: #f5f5f5;
    border-radius: 8px;
    margin-top: 20px;
    grid-column: 1 / -1;
}

/* ========== VIEW CHALLENGE PAGE ========== */
.match-view-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 3px;
}

.player {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 12px;
    width: 100%;
    max-width: 120px;
}

.challenge-details, .messages-section {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    padding: 20px;
}

.details-header, .messages-header {
    font-size: 18px;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.detail-row {
    margin-bottom: 10px;
}

.detail-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 8px;
}

/* Status badge for view challenge */
.status-badge {
    display: inline-block;
    padding: 2px 0px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 200;
    margin: 2px 0;
    color: #555;
}

/* Message box styles */
.message-box {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 6px;
    background: #f0f2f5;
}

.message-header {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.message-system {
    color: var(--primary);
    background: var(--primary-light);
}

.message-date {
    color: #888;
    font-size: 12px;
}

.message-content {
    font-size: 14px;
    line-height: 1.5;
}

/* Action buttons */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

/* ========== PHOTO/GALLERY STYLES ========== */
.photo-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.photo-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    cursor: pointer;
}

.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.photo-thumbnail:hover img {
    transform: scale(1.05);
}

/* Challenge photo */
.challenge-photo {
    margin: 8px auto;
    text-align: center;
}

.challenge-photo img {
    max-width: 60px;
    max-height: 60px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.challenge-photo img:hover {
    border-color: var(--primary);
}

/* Photo modal */
#photo-modal-bg {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

#photo-modal-bg.active {
    display: flex;
}

#photo-modal {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: var(--surface);
    border-radius: 10px;
    overflow: hidden;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#photo-modal-img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.close-x {
    position: absolute;
    right: 10px;
    top: 10px;
    background: var(--surface);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
}

/* ========== 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.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--surface);
    margin: auto;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 15px;
}

.modal-close {
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Calendar button styles */
.match-calendar {
    padding: 8px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background-color: #f9f9f9;
}

.calendar-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
}

.calendar-btn:hover {
    background-color: #45a049;
}

.calendar-btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Notification styles */
.notification {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.notification-warning {
    background-color: #f9f9f9;
    color: #333333;
}

.notification-info {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

/* ========== PENALTY POPUP ========== */
.penalty-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.penalty-popup.active {
    display: flex;
}

.penalty-popup-content {
    background-color: var(--surface);
    padding: 10px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.penalty-popup-title {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--error);
    display: flex;
    align-items: center;
    gap: 8px;
}

.penalty-popup-body {
    margin-bottom: 15px;
    line-height: 1.6;
}

.penalty-close {
    position: absolute;
    right: 10px;
    top: 10px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #777;
}

.penalty-close:hover {
    color: var(--text-primary);
}

/* ========== STATISTICS SECTION ========== */
.stats {
    display: none;
    margin-bottom: 16px;
}

.stats.active {
    display: block;
}

.stat-card {
    background: var(--surface);
    border-radius: 6px;
    padding: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.stat-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.stat-subtext {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Statistics overview cards */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.overview-card {
    background: var(--surface);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.overview-value {
    font-size: 22px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 5px;
}

.overview-label {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Chart container */
.chart-container {
    height: 200px;
    position: relative;
    margin-top: 20px;
}

/* Player list for statistics */
.player-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mover-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.mover-position {
    font-weight: 500;
    font-size: 14px;
}

/* Partner statistics */
.player-pair {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}

.player-pair-item {
    display: flex;
    align-items: center;
}

.partner-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.partner-date {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ========== RESPONSIVE STYLES ========== */
@media (max-width: 768px) {
    /* Grid layouts */
    .player-grid {
        grid-template-columns: 1fr !important; /* Force single column on mobile */
    }
    
    .challenge-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    /* Filters */
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-label {
        margin-bottom: 4px;
    }
    
    /* Buttons */
    .challenge-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    /* Match card */
    .score-container {
        width: 40px;
    }
    
    .team-side {
        padding: 12px 4px;
    }
    
    /* Keep teams side-by-side on mobile for view_challenge.php */
    .match-teams {
        flex-direction: row;
    }
    
    /* Player elements */
    .player-avatar {
        width: 60px;
        height: 60px;
        font-size: 18px;
        margin-bottom: 5px;
    }
    
    .player-name {
        font-size: 14px;
    }
    
    /* Score display */
    .score {
        font-size: 14px;
        width: 10px;
    }
    
    .score-separator {
        margin: 0 5px;
    }
    
    /* Action buttons */
    .action-buttons {
        flex-direction: column;
    }
}

/* ========== TV MODE STYLES ========== */
/* TV Mode Base Styles */
body.tv-mode {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    font-size: 1.2rem;
    line-height: 1.6;
    overflow-x: hidden;
}

/* TV Variables - extending existing root variables */
:root {
    --tv-primary: #2196F3;
    --tv-secondary: #FF5722;
    --tv-success: #4CAF50;
    --tv-warning: #FF9800;
    --tv-background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --tv-surface: rgba(255, 255, 255, 0.95);
    --tv-text-primary: #1a1a1a;
    --tv-text-secondary: #555555;
    --tv-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    --tv-border-radius: 16px;
    --tv-spacing: 2rem;
}

/* TV Container */
.tv-container {
    max-width: 100vw;
    margin: 0;
    padding: var(--tv-spacing);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* TV Header */
.tv-header {
    text-align: center;
    margin-bottom: 3rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.tv-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    margin: 1rem 0 0 0;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.tv-logo {
    margin-bottom: 1rem;
}

.tv-logo img {
    max-height: 120px;
    max-width: 300px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* TV Cards */
.tv-card {
    background: var(--tv-surface);
    border-radius: var(--tv-border-radius);
    box-shadow: var(--tv-shadow);
    margin-bottom: var(--tv-spacing);
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.tv-card-header {
    background: linear-gradient(135deg, var(--tv-primary) 0%, var(--tv-secondary) 100%);
    color: white;
    padding: 1.5rem 2rem;
    border: none;
}

.tv-card-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin: 0;
}

.tv-card-body {
    padding: 2rem;
}
