/* ============================================
   STYLE.CSS - SPIN Klub
   Green Theme with Light/Dark Mode Support
   Version: 2.0 (Optimized)
   ============================================ */

/* ============================================
   1. CSS VARIABLES (THEMES)
   ============================================ */

/* 1.1 Light Theme (default) */
:root {
    /* Colors - Green Theme */
    --primary-color: #1E5631;
    --primary-dark: #28A745;
    --primary-light: #2E7D32;
    --secondary-color: #2c3e50;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-muted: #95a5a6;
    
    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f5;
    --bg-gradient-start: #f5f7fa;
    --bg-gradient-end: #e9ecef;
    
    /* Borders & Shadows */
    --border-color: #e9ecef;
    --border-dark: #dee2e6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 20px rgba(0,0,0,0.15);
    
    /* Status Colors */
    --success: #28a745;
    --success-bg: #e8f5e8;
    --warning: #ff9800;
    --warning-bg: #fff3e0;
    --danger: #dc3545;
    --danger-bg: #ffebee;
    --info: #17a2b8;
    --info-bg: #e3f2fd;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
    
    /* Social Colors */
    --facebook: #1877f2;
    --instagram: #e4405f;
    --instagram-gradient: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 15px;
    --radius-2xl: 20px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.2s;
    --transition: 0.3s;
    --transition-slow: 0.5s;
}

/* 1.2 Dark Theme (auto-detected) */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #28A745;
        --primary-dark: #1E5631;
        --primary-light: #2E7D32;
        --secondary-color: #e5e7eb;
        --text-primary: #f3f4f6;
        --text-secondary: #9ca3af;
        --text-muted: #6b7280;
        
        --bg-primary: #1f2937;
        --bg-secondary: #111827;
        --bg-tertiary: #374151;
        --bg-gradient-start: #1f2937;
        --bg-gradient-end: #111827;
        
        --border-color: #374151;
        --border-dark: #4b5563;
        
        --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
        --shadow: 0 2px 10px rgba(0,0,0,0.3);
        --shadow-lg: 0 10px 25px rgba(0,0,0,0.3);
        --shadow-hover: 0 5px 20px rgba(0,0,0,0.4);
        
        --success-bg: #064e3b;
        --warning-bg: #451a03;
        --danger-bg: #4c0519;
        --info-bg: #0c4a6e;
    }
    
    body { background: #1a1a2a; }
}

/* ============================================
   2. RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   3. HEADER & NAVIGATION
   ============================================ */
.header {
    background: var(--bg-primary);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo a {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    background-color: #fff;
    display: block;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.logo a img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80%;
    max-height: 80%;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
    white-space: nowrap;
}

/* Contact Info */
.contact-info .phone {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

/* Navigation Menu */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color var(--transition);
}

.main-nav a:hover { color: var(--primary-color); }

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 2px 0;
    transition: var(--transition);
}

/* ============================================
   4. HERO SECTION
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    text-align: center;
    padding: 40px 20px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* ============================================
   5. BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: bold;
    transition: transform var(--transition);
    margin: 5px;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn:hover { transform: translateY(-2px); }

.btn-large {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: bold;
    transition: all var(--transition);
    margin-top: 5px;
}

.btn-large:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ============================================
   6. ABOUT SECTION
   ============================================ */
.about {
    padding: 40px 0;
    background: var(--bg-secondary);
}

.about h2, .services h2, .map-section h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
    color: var(--secondary-color);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.features {
    list-style: none;
    margin-top: 20px;
}

.features li {
    margin: 10px 0;
    font-size: 1.1rem;
}

.about-hours {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

/* ============================================
   7. SERVICES SECTION
   ============================================ */
.services {
    padding: 40px 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--bg-tertiary);
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform var(--transition);
}

.service-card:hover { transform: translateY(-5px); }

.service-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

/* ============================================
   8. MAP SECTION (Two Columns Layout)
   ============================================ */
.map-section {
    padding: 40px 0;
    background: var(--bg-secondary);
}

.map-section .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.map-content {
    padding-right: 20px;
}

.map-content h2 {
    color: var(--secondary-color);
    font-size: 2.2rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 15px;
}

.map-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.map-content address {
    font-style: normal;
    margin-bottom: 25px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.map-content address strong {
    color: var(--secondary-color);
    display: block;
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.map-content .contact-details {
    margin-bottom: 30px;
}

.map-content .contact-details p {
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
}

.map-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all var(--transition);
}

.map-content a:hover {
    color: var(--primary-dark);
    padding-left: 5px;
}

.map-content .working-hours {
    background: rgba(30, 86, 49, 0.05);
    padding: 20px;
    border-radius: var(--radius-lg);
    margin-top: 25px;
}

.map-content .working-hours h4 {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.map-content .working-hours p {
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 5px;
}

.map-content .working-hours span {
    color: var(--primary-color);
    font-weight: 600;
}

.map-container {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    transition: transform var(--transition), box-shadow var(--transition);
}

.map-container:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    display: block;
}

/* ============================================
   9. FOOTER
   ============================================ */
.footer {
    background: var(--secondary-color);
    color: white;
    padding: 40px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-links ul {
    list-style: none;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity var(--transition);
}

.footer-links a:hover { opacity: 1; }

.social-icon {
    display: inline-block;
    margin-right: 15px;
    color: white;
    text-decoration: none;
    opacity: 0.8;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Dark Theme Footer */
@media (prefers-color-scheme: dark) {
    .footer {
        background: #1f2937;
        color: #e5e7eb;
    }
    .footer-links a, .social-icon { color: #9ca3af; }
    .footer-links a:hover, .social-icon:hover {
        color: var(--primary-color);
        opacity: 1;
    }
    .footer-bottom { border-top-color: #374151; }
    .footer-bottom p { color: #6b7280; }
}

/* ============================================
   10. BOOKING PAGE STYLES
   ============================================ */
.booking-page {
    padding: 60px 0;
    background: linear-gradient(135deg, rgba(30, 86, 49, 0.05) 0%, rgba(40, 167, 69, 0.05) 100%);
    min-height: calc(100vh - 70px);
}

.booking-page h1 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--secondary-color);
    font-size: 2.5rem;
    position: relative;
    padding-bottom: 15px;
}

.booking-page h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Booking Wrapper & Grid */
.booking-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 40px;
    padding: 0 20px;
    box-sizing: border-box;
}

.booking-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Booking Form */
.booking-form {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    width: fit-content;
    min-width: 320px;
    max-width: 100%;
}

.booking-form h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.6rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 12px;
}

.booking-form h3 {
    color: var(--secondary-color);
    margin: 20px 0 12px;
    font-size: 1.2rem;
}

/* Form Elements */
.form-group { margin-bottom: 15px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--secondary-color);
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: all var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(30, 86, 49, 0.1);
}

/* Tables Grid */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 15px 0;
    max-width: 250px;
}

.table-checkbox {
    position: relative;
    display: block;
    cursor: pointer;
    margin: 0;
}

.table-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.table-square {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 4px;
    transition: all var(--transition);
    aspect-ratio: 1 / 1;
    box-shadow: var(--shadow-sm);
}

.table-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.table-status {
    font-size: 0.6rem;
    padding: 2px 4px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
}

.table-checkbox input[type="checkbox"]:not(:disabled) ~ .table-square .table-status {
    background: var(--success);
    color: white;
}

.table-checkbox input[type="checkbox"]:disabled ~ .table-square {
    background: var(--bg-secondary);
    border-color: var(--border-dark);
    opacity: 0.7;
    cursor: not-allowed;
}

.table-checkbox input[type="checkbox"]:checked ~ .table-square {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-color: var(--primary-color);
    transform: scale(1.02);
}

.table-checkbox input[type="checkbox"]:checked ~ .table-square .table-number {
    color: white;
}

.tables-hint {
    display: block;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

/* Coach Field Animation */
.coach-field { animation: slideDown var(--transition) ease; }

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Booking Info Sidebar */
.booking-info {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    position: sticky;
    top: 90px;
    width: fit-content;
    min-width: 280px;
    max-width: 100%;
}

/* Availability Checker */
.availability-checker { margin-bottom: 25px; }
.availability-checker h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.date-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    padding: 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
}

.date-selector button {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.date-selector button:hover { background: rgba(30, 86, 49, 0.1); }
.date-selector span {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 0.95rem;
}

/* Time Grid */
.time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 6px;
    max-height: 250px;
    overflow-y: auto;
    padding: 5px;
}

.time-slot {
    text-align: center;
    padding: 8px 5px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.time-slot:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.02);
}

.time-slot.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.time-slot.booked {
    background: var(--danger);
    color: white;
    opacity: 0.7;
    cursor: not-allowed;
    text-decoration: line-through;
}

.time-slot.available {
    background: var(--success);
    color: white;
}

/* Booking Rules */
.booking-rules {
    background: var(--warning-bg);
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
}

.booking-rules h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1rem;
}

.booking-rules ul { list-style: none; }
.booking-rules li {
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
    font-size: 0.9rem;
}

.booking-rules li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Prices Table */
.prices {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: var(--radius-md);
}

.prices h4 {
    color: var(--secondary-color);
    margin-bottom: 12px;
    font-size: 1rem;
}

.prices table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.prices tr { border-bottom: 1px solid var(--border-color); }
.prices td { padding: 8px 0; }
.prices td:last-child {
    text-align: right;
    font-weight: bold;
    color: var(--primary-color);
}

/* ============================================
   11. TOURNAMENT PAGE STYLES
   ============================================ */
.tournament-page {
    background: linear-gradient(135deg, rgba(30, 86, 49, 0.05) 0%, rgba(40, 167, 69, 0.05) 100%);
    min-height: calc(100vh - 70px);
}

/* Tournament Hero */
.tournament-hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 40px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tournament-hero::before {
    content: '🏓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20rem;
    opacity: 0.1;
    white-space: nowrap;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    50% { transform: translate(-50%, -50%) rotate(5deg); }
}

.tournament-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    position: relative;
}

.tournament-hero p {
    font-size: 1.3rem;
    margin-bottom: 15px;
    opacity: 0.95;
    position: relative;
}

.tournament-info {
    font-size: 1.5rem;
    font-weight: bold;
    display: inline-block;
    padding: 10px 30px;
    border-radius: var(--radius-full);
    margin-top: 20px;
}

/* Tournament List Section */
.tournament-list { padding: 40px 0; }

.tournament-list h2 {
    text-align: center;
    margin-bottom: 50px;
    color: var(--secondary-color);
    font-size: 2.5rem;
    position: relative;
    padding-bottom: 15px;
}

.tournament-list h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Tournament Cards Grid - 3 columns default */
.tournament-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

/* Tournament Card */
.tournament-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    transition: all var(--transition);
    position: relative;
}

.tournament-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tournament-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

.tournament-date {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
    text-align: center;
}

.tournament-date .day {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 5px;
}

.tournament-date .month {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.tournament-details {
    flex: 1;
    padding: 25px;
}

.tournament-details h3 {
    font-size: 1.4rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.category {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tournament-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.tournament-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.participants {
    background: var(--success-bg);
    color: var(--success) !important;
    padding: 5px 10px;
    border-radius: var(--radius-full);
}

.entry-fee {
    background: var(--warning-bg);
    color: #f57c00 !important;
    padding: 5px 10px;
    border-radius: var(--radius-full);
}

.deadline {
    background: var(--info-bg);
    color: var(--info) !important;
    padding: 5px 10px;
    border-radius: var(--radius-full);
}

.tournament-actions .btn {
    flex: 1;
    text-align: center;
    padding: 10px 15px;
}

/* Tournament Rules Section */
.tournament-rules {
    padding: 40px 0;
    background: var(--bg-secondary);
}

.tournament-rules h2 {
    text-align: center;
    margin-bottom: 50px;
    color: var(--secondary-color);
    font-size: 2.5rem;
    position: relative;
    padding-bottom: 15px;
}

.tournament-rules h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.rule {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    text-align: center;
    transition: all var(--transition);
}

.rule:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.rule-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.rule h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* Past Tournaments Section */
.past-tournaments { padding: 40px 0; }

.past-tournaments h2 {
    text-align: center;
    margin-bottom: 50px;
    color: var(--secondary-color);
    font-size: 2.5rem;
    position: relative;
    padding-bottom: 15px;
}

.past-tournaments h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.results-table {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
    overflow-x: auto;
}

.results-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.results-table th {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.results-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.results-table tr:hover td { background: rgba(30, 86, 49, 0.05); }

/* ============================================
   12. TOURNAMENT VIEW PAGE (Single Tournament)
   ============================================ */
.tournament-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.tournament-header h1 {
    font-size: 2.5rem;
    margin: 0 0 10px;
}

.tournament-date-large {
    font-size: 1.2rem;
    opacity: 0.9;
}

.tournament-status {
    display: inline-block;
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    margin-top: 15px;
}

.tournament-content {
    max-width: 1200px;
    margin: -30px auto 50px;
    padding: 0 20px;
}

/* Info Grid - 4 columns in one row */
.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}

.info-grid-winner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

.info-item {
    text-align: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.info-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.info-label {
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Tournament Card for View Page */
.tournament-content .tournament-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 30px;
    display: block;
}

.tournament-content .tournament-card h2 {
    color: var(--secondary-color);
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-left: 15px;
    border-left: 4px solid var(--primary-color);
}

/* Winners Grid - Centered */
.winners-grid {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
    width: 100%;
}

.winner-card {
    text-align: center;
    padding: 20px 25px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: transform var(--transition);
    flex: 0 1 auto;
    min-width: 180px;
}

.winner-card:hover { transform: translateY(-3px); }

.winner-icon { font-size: 2.5rem; margin-bottom: 10px; }
.winner-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}
.winner-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Participants List - Full Width */
.participants-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    width: 100%;
}

.participant-card {
    background: var(--bg-secondary);
    padding: 12px 15px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform var(--transition-fast);
}

.participant-card:hover {
    transform: translateX(5px);
    background: var(--bg-tertiary);
}

.participant-seed {
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.participant-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

/* Results List */
.results-list {
    margin-top: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.result-item {
    padding: 12px 15px;
    background: var(--bg-secondary);
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.result-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(5px);
}

.match-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.player-name {
    font-size: 0.95em;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.player-name:first-child { text-align: right; }
.player-name:last-child { text-align: left; }

.player-name.winner {
    font-weight: bold;
    color: var(--success);
    position: relative;
}

.player-name.winner:first-child::after {
    content: "🏆";
    margin-left: 8px;
    font-size: 0.9em;
}

.player-name.winner:last-child::before {
    content: "🏆";
    margin-right: 8px;
    font-size: 0.9em;
}

.match-score {
    font-weight: bold;
    font-size: 1.2em;
    min-width: 70px;
    text-align: center;
    color: var(--primary-color);
    flex-shrink: 0;
}

.match-score.pending {
    color: var(--text-muted);
    font-size: 1em;
}

.round-section { margin-bottom: 20px; }
.round-title {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--primary-color);
    color: var(--primary-color);
}

/* Registration Box */
.registration-box {
    text-align: center;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin: 20px 0;
}

.registration-box h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.btn-register {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: bold;
    transition: background var(--transition);
}

.btn-register:hover { background: var(--primary-dark); }
.btn-register.disabled {
    background: var(--text-muted);
    pointer-events: none;
    cursor: not-allowed;
}

/* ============================================
   13. RESPONSIVE DESIGN (MEDIA QUERIES)
   ============================================ */

/* Tablet & Desktop Tournament Layouts */
@media (min-width: 769px) {
    /* Special layout for single tournament */
    .booking-grid:has(.tournament-card:only-child) {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .booking-grid:has(.tournament-card:only-child) .tournament-cards {
        display: block;
        width: 100%;
    }
    
    /* When 2 tournaments - show in 2 columns */
    .tournament-cards:has(.tournament-card:nth-last-child(2):first-child) {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* If 2 tournaments with booking-info, booking-info below them */
    .booking-grid:has(.tournament-cards .tournament-card:nth-last-child(2):first-child) {
        display: flex;
        flex-direction: column;
    }
    
    .booking-grid:has(.tournament-cards .tournament-card:nth-last-child(2):first-child) .booking-info {
        width: 100%;
    }
}

/* Tablets (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .tournament-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
    /* Layout */
    .booking-grid { gap: 20px; }
    .tournament-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Header */
    .mobile-menu-toggle { display: flex; }
    .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        padding: 20px;
        box-shadow: var(--shadow);
        transform: translateY(-100%);
        opacity: 0;
        transition: all var(--transition);
        pointer-events: none;
    }
    .main-nav.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }
    .main-nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    /* Hero */
    .hero h1 { font-size: 2rem; }
    
    /* About */
    .about-grid { grid-template-columns: 1fr; }
    
    /* Map */
    .map-section .container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .map-content {
        padding-right: 0;
        text-align: center;
    }
    .map-content h2::after {
        left: 50%;
        transform: translateX(-50%);
    }
    .map-content .contact-details p { justify-content: center; }
    .map-container { max-width: 500px; }
    
    /* Booking */
    .booking-page h1 { font-size: 2rem; }
    .booking-form, .booking-info { padding: 20px; }
    
    /* Info Grids */
    .info-grid { grid-template-columns: 1fr; gap: 12px; }
    .winners-grid { flex-direction: column; align-items: center; gap: 12px; }
    .winner-card { width: 100%; max-width: 280px; }
    .participants-list { grid-template-columns: 1fr; }
    
    /* Match Info on Mobile */
    .match-info {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    .player-name:first-child,
    .player-name:last-child {
        text-align: center;
        white-space: normal;
        word-break: break-word;
    }
    .match-score { order: 2; }
    .player-name:first-child { order: 1; }
    .player-name:last-child { order: 3; }
    
    /* Tournament Card on Mobile */
    .tournament-card { flex-direction: column; text-align: center; }
    .tournament-date {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        padding: 15px;
    }
    .tournament-meta { flex-direction: column; gap: 8px; }
    .tournament-actions { flex-direction: column; }
    
    /* Tournament Hero */
    .tournament-hero h1 { font-size: 2.2rem; }
    .tournament-hero p { font-size: 1.1rem; }
    .tournament-info {
        font-size: 1.2rem;
        padding: 8px 20px;
    }
    .tournament-list h2,
    .tournament-rules h2,
    .past-tournaments h2 { font-size: 2rem; }
    
    /* Rules */
    .rules-grid { grid-template-columns: 1fr; }
    
    /* Time Grid */
    .time-grid { grid-template-columns: repeat(2, 1fr); }
    .time-slot {
        padding: 6px 4px;
        font-size: 0.8rem;
    }
    
    /* Touch Optimizations */
    button, .btn, .nav-link, .table-checkbox {
        min-height: 44px;
        min-width: 44px;
    }
    input, select, textarea {
        font-size: 16px !important;
        padding: 12px !important;
    }
    
    /* Tables Grid */
    .tables-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
    }
}

/* Small Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {
    .container { padding: 0 15px; }
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    
    .header .container { height: 60px; }
    .logo a img { height: 40px; }
    .logo-text { display: none; }
    .contact-info .phone span { display: none; }
    
    .hero {
        padding: 60px 15px;
    }
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 16px; }
    
    .cta-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .btn { width: 100%; text-align: center; }
    
    .services-grid { grid-template-columns: 1fr; }
    .service-card { padding: 20px; }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .social-icons { justify-content: center; }
    
    .map-content .working-hours p {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .tournament-hero h1 { font-size: 1.8rem; }
    .tournament-header h1 { font-size: 1.5rem; }
    
    .info-grid-winner {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .info-value { font-size: 1.2rem; }
    .participant-card { padding: 10px 12px; }
    .participant-seed {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
    .winner-icon { font-size: 2rem; }
    .winner-name { font-size: 0.9rem; }
    
    .btn-register {
        padding: 10px 25px;
        font-size: 14px;
    }
}

/* Desktop (min-width: 992px) */
@media (max-width: 992px) {
    .booking-grid { grid-template-columns: 1fr; }
    .booking-info { position: static; }
    .tournament-cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
    .tournament-hero h1 { font-size: 2.8rem; }
    .map-section .container { grid-template-columns: 1fr; }
}

/* ============================================
   14. UTILITIES & COMPONENTS
   ============================================ */

/* No Tournaments Message */
.no-tournaments {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
}

/* PWA Prompt */
.pwa-prompt {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 2000;
    max-width: 380px;
    width: calc(100% - 40px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.pwa-prompt-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.pwa-prompt-content { flex: 1; }
.pwa-prompt-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.pwa-prompt-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.pwa-prompt-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.pwa-prompt-btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pwa-prompt-btn-install {
    background: var(--primary-color);
    color: white;
}

.pwa-prompt-btn-install:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.pwa-prompt-btn-close {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.pwa-prompt-btn-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Mobile PWA Prompt */
@media (max-width: 768px) {
    .pwa-prompt {
        left: 20px;
        right: 20px;
        bottom: 20px;
        max-width: none;
        padding: 15px;
        gap: 12px;
    }
    .pwa-prompt-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .pwa-prompt-title { font-size: 14px; }
    .pwa-prompt-text { font-size: 12px; }
    .pwa-prompt-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .pwa-prompt { flex-wrap: wrap; }
    .pwa-prompt-buttons {
        width: 100%;
        justify-content: flex-end;
        margin-top: 5px;
    }
}

/* ============================================
   15. ACCESSIBILITY & PRINT STYLES
   ============================================ */

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .header, .footer, .booking-actions, .tournament-actions,
    .btn-large, .date-selector button, .time-slot, .mobile-menu-toggle {
        display: none;
    }
    
    .booking-form, .booking-info, .tournament-card, .service-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .hero, .tournament-hero {
        background: none;
        color: var(--secondary-color);
        padding: 40px 0;
    }
    
    .tournament-hero::before { display: none; }
    .rule { break-inside: avoid; }
}

/* Custom Scrollbar */
.time-grid::-webkit-scrollbar { width: 6px; }
.time-grid::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}
.time-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}
.time-grid::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* Dark Theme Support for Tournament View */
@media (prefers-color-scheme: dark) {
    .tournament-content .tournament-card { background: var(--bg-secondary); }
    .info-item, .winner-card, .participant-card, .result-item, .registration-box {
        background: var(--bg-tertiary);
    }
    .participant-card:hover, .result-item:hover { background: var(--border-color); }
}

    @keyframes pulse {
        0% { opacity: 1; }
        50% { opacity: 0.5; }
        100% { opacity: 1; }
    }