/* ============================================
   style.css - Unified Styles for SPIN Klub
   Green Theme - Light & Dark Theme Support
   ============================================ */

/* CSS Variables - 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 */
    --border-color: #e9ecef;
    --border-dark: #dee2e6;
    
    /* Shadows */
    --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;
}

/* Dark Theme */
@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;
    }
}

/* ============================================
   Reset & Base
   ============================================ */
* {
    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;
}

/* ============================================
   Header
   ============================================ */
.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 {
    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%);
    height: auto;
    width: auto;
    max-width: 80%;
    max-height: 80%;
    margin: 0;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
    white-space: nowrap;
}

.contact-info .phone {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.contact-info .icon {
    fill: currentColor;
}

/* Navigation */
.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);
}

/* ============================================
   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;
}

/* ============================================
   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);
}

/* ============================================
   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);
}

/* ============================================
   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;
}

/* ============================================
   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 .contact-details i {
    width: 24px;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.map-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
}

.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;
    font-size: 1.1rem;
}

.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;
}

/* ============================================
   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);
}

@media (prefers-color-scheme: dark) {
    .footer {
        background: #1f2937;
        color: #e5e7eb;
    }
    
    .footer-links a {
        color: #9ca3af;
    }
    
    .footer-links a:hover {
        color: var(--primary-color);
        opacity: 1;
    }
    
    .social-icon {
        color: #9ca3af;
    }
    
    .social-icon:hover {
        color: var(--primary-color);
        opacity: 1;
    }
    
    .footer-bottom {
        border-top-color: #374151;
    }
    
    .footer-bottom p {
        color: #6b7280;
    }
}

/* ============================================
   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 {
    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;
    align-items: start;
    width: fit-content; /* ширина по содержимому */
    max-width: 100%;
}

/* Форма - подстраивается под содержимое */
.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-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 {
    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;
    line-height: 1;
}

.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;
    letter-spacing: 0.3px;
}

.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: slideDown var(--transition) ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.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);
}

/* Блок информации справа */
.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 {
    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 {
    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 {
    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;
    margin: 0;
    padding: 0;
}

.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 {
    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);
}

/* Медиа-запрос для мобильных устройств */
@media (max-width: 768px) {
    .booking-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .booking-form,
    .booking-info {
        width: 100%;
        min-width: auto;
    }
    
    .tables-grid {
        max-width: 100%;
        gap: 10px;
    }
    
    .table-square {
        padding: 6px 3px;
    }
    
    .table-number {
        font-size: 1rem;
    }
    
    .booking-wrapper {
        padding: 0 15px;
        margin-top: 30px;
    }
}
/* ============================================
   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 {
    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 {
    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 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.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-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.tournament-actions {
    display: flex;
}

.tournament-actions .btn {
    flex: 1;
    text-align: center;
    padding: 10px 15px;
}

.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;
}

.rule p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.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;
    font-size: 1rem;
}

.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);
}

/* ============================================
   Tournament View Page Styles
   ============================================ */
.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 - IN ONE ROW */
.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 0;
    width: 100%;
}
.info-grid-winner{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 0;
    width: 100%;
}

/* Для маленьких мобильных устройств */
@media (max-width: 480px) {
    .info-grid-winner {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
.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);
    display: block;
    width: 100%;
}

/* Winners Grid - CENTERED */
.winners-grid {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-top: 20px;
    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;
    margin-top: 20px;
    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;
}

.registration-box p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.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;
    font-size: 16px;
    transition: background var(--transition);
}

.btn-register:hover {
    background: var(--primary-dark);
}

.btn-register.disabled {
    background: var(--text-muted);
    pointer-events: none;
    cursor: not-allowed;
}

/* 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);
    }
}

/* Responsive Design for Tournament View */
@media (max-width: 992px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .participants-list {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .tournament-header {
        padding: 40px 20px;
    }
    
    .tournament-header h1 {
        font-size: 1.8rem;
    }
    
    .tournament-date-large {
        font-size: 1rem;
    }
    
    .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 {
        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-content .tournament-card {
        padding: 20px;
    }
    
    .tournament-content .tournament-card h2 {
        font-size: 1.2rem;
    }
    
    .results-list {
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    .tournament-header h1 {
        font-size: 1.5rem;
    }
    
    .tournament-status {
        font-size: 0.85rem;
        padding: 4px 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;
    }
}

/* ============================================
   Mobile Optimizations
   ============================================ */
@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;
    }
    
    .booking-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .tables-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
    }
    
    .table-number {
        font-size: 1.2rem;
    }
    
    .table-status {
        font-size: 0.6rem;
        padding: 2px 4px;
    }
    
    .time-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tournament-card {
        flex-direction: column;
        text-align: center;
    }
    
    .tournament-date {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        padding: 15px;
    }
    
    .tournament-date .day {
        font-size: 2rem;
    }
    
    .tournament-date .month {
        font-size: 1rem;
    }
    
    .tournament-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .tournament-actions {
        flex-direction: column;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-logo img {
        margin: 0 auto;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .map-content h2::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .map-content .working-hours p {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
}

@media (max-width: 768px) {
    .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;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .map-section .container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .map-content {
        padding-right: 0;
        text-align: center;
    }
    
    .map-content h2 {
        display: inline-block;
        position: relative;
        padding-bottom: 10px;
        margin-bottom: 15px;
    }
    
    .map-content h2::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 3px;
        background: var(--primary-color);
        border-radius: 2px;
    }
    
    .map-content .contact-details p {
        justify-content: center;
    }
    
    .map-container {
        max-width: 500px;
    }
    
    .booking-page h1 {
        font-size: 2rem;
    }
    
    .booking-form,
    .booking-info {
        padding: 20px;
    }
    
    .tournament-cards {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .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-grid {
        grid-template-columns: 1fr;
    }
    
    .time-slot {
        padding: 6px 4px;
        font-size: 0.8rem;
    }
    
    button, 
    .btn,
    .nav-link,
    .table-checkbox {
        min-height: 44px;
        min-width: 44px;
    }
    
    input, 
    select, 
    textarea {
        font-size: 16px !important;
        padding: 12px !important;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .card {
        margin-bottom: 15px;
    }
}

@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;
    }
}


/* ============================================
   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 {
        background: none;
        color: var(--secondary-color);
        padding: 40px 0;
    }
    
    .tournament-hero {
        background: none;
        color: var(--secondary-color);
        padding: 40px 0;
    }
    
    .tournament-hero::before {
        display: none;
    }
    
    .rule {
        break-inside: avoid;
    }
}

/* ============================================
   Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   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);
}


/* 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;
    color: var(--white);
}

/* Текстовая часть */
.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: var(--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);
}

/* Адаптивность */
@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;
    }
}