/* ====== Фирменные цвета: красный, серый, черный ====== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --red-primary:   #C41E3A;
    --red-dark:      #8B0000;
    --red-accent:    #DC143C;
    --gray-light:    #B0B0B0;
    --gray-mid:      #6B6B6B;
    --gray-dark:     #2E2E2E;
    --black-deep:    #111111;
    --black-soft:    #1A1A1A;
    --green-free:    #2E7D32;
    --orange-booked: #E65100;
    --shadow:        0 4px 16px rgba(0,0,0,0.6);
    --radius:        8px;
}

/* ====== BASE ====== */
body {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--black-deep);
    color: #E0E0E0;
    line-height: 1.6;
    min-height: 100vh;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ====== HERO секция (фон до "Выберите дату") ====== */
.hero-section {
    position: relative;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('/img/фон.jpg') center center / cover no-repeat;
    z-index: -2;
}
.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: -1;
}

/* ====== Шапка ====== */
.header {
    z-index: 100;
    overflow: visible;
}
.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 20px 1.25rem;
    max-width: 1200px;
    margin: 0 auto;
}
.header-logo {
    max-width: 320px;
    height: auto;
    display: block;
}
.club-subtitle {
    font-size: 1.1rem;
    color: var(--gray-light);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 300;
}
.rates-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 20px;
}
.rate-item {
    font-size: 0.85rem;
    color: var(--gray-light);
}
.rate-item strong {
    color: var(--gray-light);
    font-size: 0.95rem;
}

/* ====== Объявления ====== */
.announcement {
    color: #fff;
    padding: 0.75rem 1.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: pre-wrap;
}

/* ====== Секции ====== */
.section { margin: 2rem 0; }
.section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--gray-light);
    font-size: 1.4rem;
    font-weight: 400;
    position: relative;
    padding-bottom: 0.75rem;
}

/* ====== Календарь ====== */
.calendar-row { display: flex; justify-content: center; align-items: center; gap: 1rem; }
.calendar-label {
    color: var(--gray-light);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.5px;
}
.calendar-input {
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    font-family: 'Montserrat', sans-serif;
    background: var(--gray-dark);
    color: #E0E0E0;
    border: 1px solid var(--gray-mid);
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.calendar-input:hover {
    border-color: var(--gray-light);
    background: #333;
}
.calendar-input:focus {
    border-color: var(--red-primary);
    box-shadow: 0 0 0 3px rgba(196,30,58,0.2);
}
.calendar-input::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}
.calendar-input::-webkit-calendar-picker-indicator:hover {
    background: rgba(255,255,255,0.1);
}
/* Стилизация всплывающего календаря (Chrome/Edge) */
::-webkit-datetime-edit { padding: 0; }
::-webkit-datetime-edit-fields-wrapper { padding: 0; }
::-webkit-datetime-edit-text { color: var(--gray-light); }
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-year-field {
    color: #E0E0E0;
    font-weight: 500;
}

/* ====== Залы ====== */
.halls-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}
.hall {
    background: transparent;
    border: 2px solid var(--gray-mid);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: visible;
}
/* Бейдж с названием зала */
.hall-badge {
    position: absolute;
    top: -13px;
    left: 20px;
    background: var(--gray-mid);
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
    white-space: nowrap;
    z-index: 1;
}
.tables-grid { display: grid; grid-template-columns: repeat(3, 80px); gap: 1rem; justify-content: center; }
.pool-table {
    background: url('/img/stol.png') center center / cover no-repeat;
    color: white;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    font-weight: 700;
    font-size: 1.4rem;
    width: 80px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.pool-table:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    filter: brightness(1.15);
}

/* Стол 1 — отдельная картинка, не бронируется */
.pool-table.table-1 {
    background: url('/img/stol1.png') center center / cover no-repeat;
    cursor: not-allowed;
}

/* Заметка под залом */
.hall-note {
    text-align: center;
    color: var(--gray-mid);
    font-size: 0.8rem;
    margin-top: 1rem;
    font-style: italic;
}

/* ====== Таблица бронирований ====== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-height: 70vh;
    overflow-y: auto;
}
.booking-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--black-soft);
    table-layout: fixed;
}
.booking-table th,
.booking-table td {
    padding: 0;
    text-align: center;
    border: 1px solid var(--gray-mid);
    font-size: 0.65rem;
    position: relative;
}
.time-header {
    width: 110px;
    min-width: 110px;
    background: linear-gradient(180deg, var(--gray-dark) 0%, #222 100%);
    color: var(--gray-light);
    font-size: 0.65rem;
    padding: 4px 2px;
}
.table-header {
    background: linear-gradient(180deg, var(--gray-dark) 0%, #222 100%);
    color: var(--gray-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.65rem;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 4px 2px;
}
.time-cell {
    background: var(--gray-dark);
    color: var(--gray-light);
    font-weight: 700;
    font-size: 0.65rem;
    position: sticky;
    left: 0;
    z-index: 1;
    white-space: nowrap;
    width: 110px;
    min-width: 110px;
    padding: 4px 2px;
    line-height: normal;
}
.booking-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}
.booking-table tbody tr {
    height: 28px;
}
.booking-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.cell-free {
    background: rgba(46,125,50,0.2);
    cursor: pointer;
    color: transparent;
    transition: background 0.2s;
    position: relative;
    line-height: normal;
}
.cell-free::after {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--gray-mid);
    font-size: 1.2rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.cell-free:hover { background: rgba(46,125,50,0.4); }
.cell-free:hover::after { opacity: 1; }
.cell-booked {
    background: #7F0000;
    color: #FFB0B0;
    cursor: pointer;
}
.booked-inner {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    gap: 1px;
    line-height: 1;
}
.booked-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1;
    margin: 0;
}
.cell-booked small {
    display: block;
    opacity: 0.7;
    font-size: 0.5rem;
    white-space: nowrap;
    line-height: 1;
    margin: 0;
}
.cell-past {
    background: rgba(80,80,80,0.3);
    color: transparent;
    cursor: default;
    line-height: normal;
}
.cell-vip {
    background: rgba(139,0,0,0.2);
    color: var(--gray-mid);
    font-size: 0.65rem;
    font-weight: 700;
    cursor: not-allowed;
}

/* ====== Модалки ====== */
.modal {
    display: none; position: fixed; z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); animation: fadeIn 0.3s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
    background: var(--gray-dark);
    border: 2px solid var(--gray-mid);
    border-radius: 12px;
    margin: 5% auto;
    padding: 2rem;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    position: relative;
}
.modal-content h2 { color: var(--gray-light); margin-bottom: 1.5rem; font-size: 1.3rem; }
.close {
    position: absolute; right: 1.25rem; top: 0.75rem;
    font-size: 2rem; cursor: pointer; color: var(--gray-light); transition: color 0.2s;
}
.close:hover { color: #fff; }

/* ====== Формы ====== */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block; margin-bottom: 0.4rem; color: var(--gray-light);
    font-size: 0.9rem; font-weight: 500;
}
.form-group input, .form-group select {
    width: 100%; padding: 0.7rem 1rem; background: var(--black-soft); color: #E0E0E0;
    border: 1px solid var(--gray-mid); border-radius: 6px; font-size: 1rem;
    outline: none; transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--gray-light); }
.price-display { font-size: 1.4rem; font-weight: 700; color: var(--gray-light); }

/* ====== Кнопки ====== */
.btn {
    padding: 0.75rem 1.5rem; border: none; border-radius: 6px; font-size: 1rem;
    cursor: pointer; font-weight: 600; transition: background 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-gold {
    background: linear-gradient(180deg, var(--red-primary) 0%, var(--red-dark) 100%);
    color: #fff;
}
.btn-gold:hover {
    background: linear-gradient(180deg, var(--red-accent) 0%, var(--red-primary) 100%);
}
.btn-gold:disabled { background: #444; color: #888; cursor: not-allowed; }
.btn-wood {
    background: var(--gray-mid); color: #E0E0E0;
}
.btn-wood:hover { background: var(--gray-light); color: #111; }

/* ====== Правила ====== */
.rules-text {
    background: rgba(0,0,0,0.3); padding: 1.25rem; border-radius: 8px; margin: 1rem 0;
    max-height: 250px; overflow-y: auto; border: 1px solid var(--gray-mid);
    white-space: pre-wrap;
}
.rules-text p { margin-bottom: 0.6rem; color: var(--gray-light); }
.rules-checkbox {
    display: flex; align-items: center; gap: 0.6rem;
    margin: 1rem 0; padding: 0.75rem 1rem;
    background: rgba(0,0,0,0.2); border: 1px solid var(--gray-mid);
    border-radius: 6px; cursor: pointer; font-size: 0.95rem; color: #E0E0E0;
    transition: background 0.2s;
}
.rules-checkbox:hover { background: rgba(255,255,255,0.05); }
.rules-checkbox input[type="checkbox"] {
    width: 18px; height: 18px; flex-shrink: 0; cursor: pointer;
    accent-color: var(--gray-light);
}
.rules-actions { display: flex; gap: 1rem; margin-top: 0.5rem; }

/* ====== Тарифы ====== */
.rates-info { background: rgba(0,0,0,0.3); padding: 1rem; border-radius: 8px; border: 1px solid var(--gray-mid); }
.rates-table-info { width: 100%; border-collapse: collapse; }
.rates-table-info th {
    background: var(--gray-dark); color: var(--gray-light);
    padding: 0.75rem 1rem; text-align: left; border: 1px solid var(--gray-mid);
}
.rates-table-info td {
    padding: 0.75rem 1rem; border: 1px solid var(--gray-mid);
    color: #E0E0E0;
}
.rates-table-info tbody tr:hover { background: rgba(255,255,255,0.05); }
.rates-note { margin-top: 1rem; padding: 0.75rem; background: rgba(255,255,255,0.05); border-radius: 6px; color: var(--gray-light); font-size: 0.9rem; }

/* ====== Контакты ====== */
.contacts-info { display: flex; flex-direction: column; gap: 1rem; }
.contact-item {
    display: flex; gap: 1rem; align-items: flex-start; padding: 1rem;
    background: rgba(0,0,0,0.3); border-radius: 8px; border: 1px solid var(--gray-mid);
}
.contact-icon { font-size: 2rem; flex-shrink: 0; }
.contact-item h4 { color: var(--gray-light); margin-bottom: 0.25rem; font-size: 0.95rem; }
.contact-item p { margin: 0; color: var(--gray-light); }
.contact-item a { text-decoration: none; }
.contact-item a:hover { text-decoration: underline; }

/* ====== Правила (полные) ====== */
.rules-full {
    background: rgba(0,0,0,0.3); padding: 1.25rem; border-radius: 8px;
    max-height: 350px; overflow-y: auto; border: 1px solid var(--gray-mid);
}
.rules-full p { margin-bottom: 0.75rem; color: var(--gray-light); line-height: 1.7; }

/* ====== Cookie баннер ====== */
.cookie-banner {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--gray-dark); border-top: 2px solid var(--gray-mid);
    color: #E0E0E0; padding: 1rem 1.5rem; z-index: 999;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5); animation: slideUp 0.3s;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.cookie-inner {
    max-width: 1200px; margin: 0 auto; display: flex; align-items: center;
    justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.cookie-banner p { flex: 1; min-width: 200px; margin: 0; font-size: 0.9rem; }

/* ====== Модалка ошибки ====== */
.error-text {
    width: 100%; min-height: 120px; max-height: 300px; padding: 0.75rem;
    background: rgba(0,0,0,0.4); color: #ff6b6b; border: 1px solid var(--gray-mid);
    border-radius: 6px; font-family: 'Courier New', monospace; font-size: 0.8rem;
    resize: vertical; line-height: 1.5; user-select: all;
}

/* ====== Подвал ====== */
.footer {
    background: var(--black-soft); border-top: 3px solid var(--gray-mid);
    color: var(--gray-light); padding: 2rem 0; margin-top: 3rem;
}
.footer .container { text-align: center; }
.footer-announcements {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(196,30,58,0.08);
    border-radius: 8px;
    border: 1px solid rgba(196,30,58,0.2);
}
.footer-announcements p {
    margin: 0;
    color: var(--gray-light);
    line-height: 1.6;
    white-space: pre-wrap;
}
.footer-announcements a {
    color: #E0E0E0;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s, text-decoration 0.2s;
}
.footer-announcements a:hover {
    color: #fff;
    text-decoration: none;
}
.footer p { margin-bottom: 0.4rem; }
.footer-phone {
    font-size: 1.3rem; font-weight: 600; color: var(--gray-light); margin-bottom: 0.5rem;
}
.footer-phone a {
    color: var(--gray-light); text-decoration: none; transition: color 0.2s;
}
.footer-phone a:hover { color: #fff; text-decoration: underline; }

/* ====== Мои бронирования в таблице ====== */
.my-booking-cell {
    background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(212,175,55,0.08)) !important;
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: 4px;
    margin: 2px;
    transition: all 0.2s ease;
}
.my-booking-cell:hover {
    background: linear-gradient(135deg, rgba(212,175,55,0.25), rgba(212,175,55,0.15)) !important;
    box-shadow: 0 2px 8px rgba(212,175,55,0.2);
}

.btn-cancel {
    transition: all 0.2s ease;
}
.btn-cancel:hover {
    background: #a01830 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196,30,58,0.3);
}

/* ====== Адаптив ====== */
@media (max-width: 768px) {
    .rates-bar { flex-direction: column; align-items: center; gap: 0.5rem; }
    .modal-content { margin: 10% 0.75rem; padding: 1.25rem; }
    .rules-actions { flex-direction: column; }
    .booking-table th, .booking-table td { padding: 0.35rem 0.15rem; font-size: 0.6rem; }
    .table-header { font-size: 0.55rem; }
    .time-cell { font-size: 0.65rem; }
}
@media (max-width: 480px) {
    .halls-grid { grid-template-columns: 1fr; }
    .cookie-inner { flex-direction: column; text-align: center; }
    .club-subtitle { font-size: 0.9rem; letter-spacing: 2px; }
    .pool-table { font-size: 1.2rem; }
    .booking-table th, .booking-table td { padding: 0.3rem 0.1rem; font-size: 0.55rem; }
}
