/* booking.css - Стили для страницы бронирования клуба SpinPG */

/* Booking Page Layout */
.booking-page {
    padding: 60px 0;
    background: linear-gradient(135deg, #667eea0d 0%, #764ba20d 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 Grid - ИСПРАВЛЕНО: уменьшил левую колонку */
.booking-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;  /* поменял соотношение */
    gap: 30px;
    align-items: start;
}

/* Booking Form Styles - ИСПРАВЛЕНО: более компактная форма */
.booking-form {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.booking-form h2 {
    color: var(--primary-color);
    margin-bottom: 20px;  /* уменьшил с 25px */
    font-size: 1.6rem;  /* уменьшил с 1.8rem */
    border-left: 4px solid var(--primary-color);  /* уменьшил с 5px */
    padding-left: 12px;  /* уменьшил с 15px */
}

.booking-form h3 {
    color: var(--secondary-color);
    margin: 20px 0 12px;  /* уменьшил отступы */
    font-size: 1.2rem;  /* уменьшил с 1.3rem */
}

/* Form Groups - ИСПРАВЛЕНО: уменьшил отступы */
.form-group {
    margin-bottom: 15px;  /* уменьшил с 20px */
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));  /* уменьшил мин. ширину */
    gap: 12px;  /* уменьшил с 15px */
}

label {
    display: block;
    margin-bottom: 5px;  /* уменьшил с 8px */
    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;  /* уменьшил с 12px 15px */
    border: 2px solid #e0e0e0;
    border-radius: 6px;  /* уменьшил с 8px */
    font-size: 0.95rem;  /* уменьшил с 1rem */
    transition: all 0.3s;
    background: var(--white);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 69, 0, 0.1);  /* уменьшил с 3px */
}

input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
}

/* Tables Grid - ИСПРАВЛЕНО: уменьшил размер квадратов */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;  /* уменьшил с 15px */
    margin: 15px 0;  /* уменьшил с 20px */
    max-width: 350px;  /* уменьшил с 400px */
}

.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(--white);
    border: 2px solid #e0e0e0;
    border-radius: 8px;  /* уменьшил с 12px */
    padding: 12px 5px;  /* уменьшил с 20px 10px */
    transition: all 0.3s;
    aspect-ratio: 1 / 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);  /* уменьшил тень */
}

/* Table number - ИСПРАВЛЕНО: уменьшил размер */
.table-number {
    font-size: 1.5rem;  /* уменьшил с 2rem */
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 4px;  /* уменьшил с 8px */
    line-height: 1;
}

/* Status indicator - ИСПРАВЛЕНО: уменьшил размер */
.table-status {
    font-size: 0.7rem;  /* уменьшил с 0.75rem */
    padding: 3px 6px;  /* уменьшил с 4px 8px */
    border-radius: 12px;  /* уменьшил с 20px */
    background: #f0f0f0;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;  /* уменьшил с 0.5px */
}

/* Available status */
.table-checkbox input[type="checkbox"]:not(:disabled) ~ .table-square .table-status {
    background: #4caf50;
    color: white;
}

/* Booked status - disabled checkbox */
.table-checkbox input[type="checkbox"]:disabled ~ .table-square {
    background: #f5f5f5;
    border-color: #ddd;
    opacity: 0.7;
    cursor: not-allowed;
}

.table-checkbox input[type="checkbox"]:disabled ~ .table-square .table-number {
    color: #999;
}

.table-checkbox input[type="checkbox"]:disabled ~ .table-square .table-status {
    background: #f44336;
    color: white;
}

/* Hover effect for available tables */
.table-checkbox input[type="checkbox"]:not(:disabled):hover ~ .table-square {
    transform: translateY(-3px);  /* уменьшил с 5px */
    border-color: var(--primary-color);
    box-shadow: 0 5px 12px rgba(255, 69, 0, 0.15);  /* уменьшил тень */
}

/* Selected state */
.table-checkbox input[type="checkbox"]:checked ~ .table-square {
    background: linear-gradient(135deg, var(--primary-color), #FF6B35);
    border-color: var(--primary-color);
    transform: scale(1.02);  /* уменьшил с 1.05 */
}

.table-checkbox input[type="checkbox"]:checked ~ .table-square .table-number {
    color: white;
}

.table-checkbox input[type="checkbox"]:checked ~ .table-square .table-status {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Hint text - ИСПРАВЛЕНО: уменьшил отступ */
.tables-hint {
    display: block;
    margin-top: 10px;  /* уменьшил с 15px */
    color: #666;
    font-size: 0.85rem;  /* уменьшил с 0.9rem */
    font-style: italic;
}

/* Responsive */
@media (max-width: 480px) {
    .tables-grid {
        gap: 8px;  /* уменьшил с 10px */
        max-width: 100%;
    }
    
    .table-number {
        font-size: 1.2rem;  /* уменьшил с 1.5rem */
    }
    
    .table-status {
        font-size: 0.6rem;  /* уменьшил с 0.65rem */
        padding: 2px 4px;  /* уменьшил с 3px 6px */
    }
}

/* Coach Field */
.coach-field {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Submit Button - ИСПРАВЛЕНО: уменьшил размер */
.btn-large {
    width: 100%;
    padding: 12px;  /* уменьшил с 15px */
    font-size: 1rem;  /* уменьшил с 1.1rem */
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 6px;  /* уменьшил с 8px */
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    margin-top: 5px;  /* добавил небольшой отступ */
}

.btn-large:hover {
    background: #ff3300;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 69, 0, 0.25);  /* уменьшил тень */
}

/* Booking Info Sidebar - ИСПРАВЛЕНО: увеличил padding для баланса */
.booking-info {
    background: var(--white);
    padding: 30px;  /* одинаковый padding */
    border-radius: 15px;  /* одинаковый радиус */
    box-shadow: var(--shadow);  /* одинаковая тень */
    position: sticky;
    top: 90px;
}

/* Availability Checker - ИСПРАВЛЕНО: уменьшил отступы */
.availability-checker {
    margin-bottom: 25px;  /* уменьшил с 30px */
}

.availability-checker h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;  /* уменьшил с 20px */
    font-size: 1.2rem;  /* уменьшил с 1.3rem */
}

.date-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--light-bg);
    padding: 8px;  /* уменьшил с 10px */
    border-radius: 6px;  /* уменьшил с 8px */
    margin-bottom: 15px;  /* уменьшил с 20px */
}

.date-selector button {
    background: none;
    border: none;
    font-size: 1.3rem;  /* уменьшил с 1.5rem */
    cursor: pointer;
    color: var(--primary-color);
    padding: 4px 8px;  /* уменьшил с 5px 10px */
    border-radius: 4px;  /* уменьшил с 5px */
    transition: all 0.3s;
}

.date-selector button:hover {
    background: rgba(255, 69, 0, 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));  /* уменьшил с 80px */
    gap: 6px;  /* уменьшил с 10px */
    max-height: 250px;  /* уменьшил с 300px */
    overflow-y: auto;
    padding: 5px;
}

.time-slot {
    text-align: center;
    padding: 8px 5px;  /* уменьшил с 10px */
    background: var(--light-bg);
    border-radius: 4px;  /* уменьшил с 6px */
    font-size: 0.85rem;  /* уменьшил с 0.9rem */
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.time-slot:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: scale(1.02);  /* уменьшил с 1.05 */
}

.time-slot.selected {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.time-slot.booked {
    background: #f44336;
    color: var(--white);
    opacity: 0.7;
    cursor: not-allowed;
    text-decoration: line-through;
}

.time-slot.booked:hover {
    transform: none;
    background: #f44336;
}

.time-slot.available {
    background: #4caf50;
    color: var(--white);
}

/* Booking Rules - ИСПРАВЛЕНО: уменьшил отступы */
.booking-rules {
    background: #fff3e0;
    padding: 15px;  /* уменьшил с 20px */
    border-radius: 8px;  /* уменьшил с 10px */
    margin-bottom: 25px;  /* уменьшил с 30px */
}

.booking-rules h4 {
    color: var(--primary-color);
    margin-bottom: 10px;  /* уменьшил с 15px */
    font-size: 1rem;  /* уменьшил с 1.1rem */
}

.booking-rules ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.booking-rules li {
    margin: 8px 0;  /* уменьшил с 10px */
    padding-left: 20px;  /* уменьшил с 25px */
    position: relative;
    font-size: 0.9rem;  /* уменьшил с 0.95rem */
}

.booking-rules li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.9rem;  /* добавил размер */
}

/* Prices Table - ИСПРАВЛЕНО: уменьшил отступы */
.prices {
    background: var(--light-bg);
    padding: 15px;  /* уменьшил с 20px */
    border-radius: 8px;  /* уменьшил с 10px */
}

.prices h4 {
    color: var(--secondary-color);
    margin-bottom: 12px;  /* уменьшил с 15px */
    font-size: 1rem;  /* уменьшил с 1.1rem */
}

.prices table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;  /* добавил размер */
}

.prices tr {
    border-bottom: 1px solid #ddd;
}

.prices tr:last-child {
    border-bottom: none;
}

.prices td {
    padding: 8px 0;  /* уменьшил с 10px */
}

.prices td:last-child {
    text-align: right;
    font-weight: bold;
    color: var(--primary-color);
}

/* Form Validation Styles */
input:invalid,
select:invalid {
    border-color: #f44336;
}

input:invalid:focus,
select:invalid:focus {
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.1);  /* уменьшил с 3px */
}

.error-message {
    color: #f44336;
    font-size: 0.8rem;  /* уменьшил с 0.85rem */
    margin-top: 4px;  /* уменьшил с 5px */
}

/* Loading States */
.loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 25px;  /* уменьшил с 30px */
    height: 25px;  /* уменьшил с 30px */
    border: 2px solid var(--light-bg);  /* уменьшил с 3px */
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Success Message */
.success-message {
    background: #4caf50;
    color: var(--white);
    padding: 12px;  /* уменьшил с 15px */
    border-radius: 6px;  /* уменьшил с 8px */
    margin-bottom: 15px;  /* уменьшил с 20px */
    display: flex;
    align-items: center;
    gap: 8px;  /* уменьшил с 10px */
    animation: slideIn 0.3s ease;
    font-size: 0.95rem;  /* добавил размер */
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .booking-grid {
        grid-template-columns: 1fr;  /* на мобильных одна колонка */
    }
    
    .booking-info {
        position: static;
    }
}

@media (max-width: 768px) {
    .booking-page {
        padding: 40px 0;
    }
    
    .booking-page h1 {
        font-size: 2rem;
    }
    
    .booking-form,
    .booking-info {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .tables-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));  /* уменьшил с 80px */
    }
    
    .time-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));  /* уменьшил с 70px */
    }
}

@media (max-width: 480px) {
    .booking-page h1 {
        font-size: 1.8rem;
    }
    
    .booking-form h2 {
        font-size: 1.4rem;  /* уменьшил с 1.5rem */
    }
    
    .date-selector {
        flex-wrap: wrap;
        gap: 8px;  /* уменьшил с 10px */
    }
    
    .date-selector span {
        order: -1;
        width: 100%;
        text-align: center;
    }
    
    .tables-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .time-slot {
        padding: 6px 4px;  /* уменьшил с 8px 5px */
        font-size: 0.8rem;  /* уменьшил с 0.85rem */
    }
}

/* Print Styles */
@media print {
    .booking-page {
        background: none;
        padding: 20px;
    }
    
    .booking-form,
    .booking-info {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn-large,
    .date-selector button,
    .time-slot {
        display: none;
    }
}

/* 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;  /* уменьшил с 8px */
}

.time-grid::-webkit-scrollbar-track {
    background: var(--light-bg);
    border-radius: 3px;  /* уменьшил с 4px */
}

.time-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;  /* уменьшил с 4px */
}

.time-grid::-webkit-scrollbar-thumb:hover {
    background: #ff3300;
}