/* Dashboard Styles */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    min-height: 100vh; 
}

.container { 
    max-width: 1000px; 
    margin: 0 auto; 
    padding: 20px; 
}

.navbar { 
    background: #fff; 
    border-radius: 12px; 
    margin-bottom: 16px; 
    box-shadow: 0 2px 8px rgba(0,0,0,.05); 
}

.block { 
    background: #fff; 
    border-radius: 12px; 
    padding: 16px; 
    box-shadow: 0 2px 8px rgba(0,0,0,.05); 
}

.hero { 
    position: relative; 
    overflow: hidden; 
    border-radius: 16px; 
    padding: 24px; 
    margin-bottom: 16px; 
    color: #fff; 
    background: linear-gradient(135deg, rgba(52, 152, 219, .85), rgba(142, 68, 173, .85)); 
    box-shadow: 0 10px 30px rgba(0,0,0,.15); 
}

.hero h1 { 
    font-size: 1.6rem; 
    margin: 0 0 15px; 
    font-weight: 600; 
}

.hero .logo { 
    width: 100px; 
    height: auto; 
    filter: invert(1);
    margin-right: 10px; 
}

.hero p { 
    margin: 0 0 12px; 
    opacity: .9; 
}

.hero .btn { 
    box-shadow: 0 8px 20px rgba(255,255,255,.25); 
}

.rooms-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
    gap: 12px; 
}

.room-tile { 
    border: 2px solid #e9ecef; 
    border-radius: 10px; 
    padding: 12px; 
    cursor: pointer; 
    transition: border-color .15s, transform .2s ease, box-shadow .2s ease; 
}

.room-tile .fw-semibold {
    text-transform: uppercase;
}

.room-tile:hover { 
    border-color: #0d6efd; 
}

.room-tile.active { 
    border-color: #0d6efd; 
    background: #eef5ff; 
    transform: scale(1.02); 
    box-shadow: 0 6px 18px rgba(13,110,253,.18); 
}

.timeline { 
    max-height: 520px; 
    overflow-y: auto; 
    border: 1px solid #e9ecef; 
    border-radius: 10px; 
    animation: fadeSlideUp .25s ease both; 
}

.slot { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 6px 10px; 
    border-bottom: 1px dashed #f0f0f0; 
    cursor: pointer; 
    user-select: none; 
    transition: background-color .15s ease; 
}

.slot:last-child { 
    border-bottom: none; 
}

.slot .time { 
    color: #6c757d; 
    font-size: 13px; 
}

.slot .who { 
    margin-left: auto; 
    font-size: 12px; 
    background: linear-gradient(135deg, #9b59b6, #8e44ad); 
    color: #fff; 
    padding: 2px 8px; 
    border-radius: 12px; 
}

.slot.booked { 
    background: #f8f9fa; 
    color: #adb5bd; 
    cursor: not-allowed; 
}

.slot.selected { 
    background: rgba(13,110,253,.18); 
    animation: pulseSelect 1s ease both; 
}

.slot.anchor { 
    border-left: 4px solid #0d6efd; 
    background: rgba(13,110,253,.08); 
}

.calendar-controls { 
    display: flex; 
    gap: 12px; 
    align-items: center; 
}

.hint { 
    color: #6c757d; 
    font-size: 13px; 
}

.modal-footer .btn { 
    min-width: 140px; 
}

.btn-toggle .btn { 
    min-width: 110px; 
}

#timePickers.d-none { 
    display: none !important; 
}

.bookings-list .booking-item { 
    background: rgba(255,255,255,.85); 
    border: none; 
    border-radius: 12px; 
    padding: 12px; 
    box-shadow: 0 2px 10px rgba(0,0,0,.06); 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    animation: fadeSlideUp .25s ease both; 
    flex-wrap: wrap;
}

.bookings-list .avatar { 
    width: 36px; 
    height: 36px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 700; 
    color: #fff; 
    background: linear-gradient(135deg, #e67e22, #d35400); 
}

.bookings-list .time { 
    font-weight: 600; 
    color: #2c3e50; 
}

.bookings-list .name { 
    font-weight: 600; 
}

.bookings-list .comment { 
    color: #6c757d; 
}

/* Friendly modal styles */
.modal-content { 
    border-radius: 16px; 
    border: none; 
    box-shadow: 0 20px 40px rgba(0,0,0,.2); 
}

.modal-header, .modal-footer { 
    border: none; 
}

.step-title { 
    font-weight: 600; 
    color: #2c3e50; 
}

.form-label { 
    color: #5c6b7a; 
    font-weight: 500; 
}

.btn-primary { 
    box-shadow: 0 8px 20px rgba(13,110,253,.25); 
}

/* Floating Reserve Button */
.fab-reserve { 
    position: fixed; 
    right: 16px; 
    bottom: 16px; 
    z-index: 1; 
}

.fab-reserve .btn {
    padding: 14px 20px; 
    border-radius: 999px; 
    font-weight: 600; 
    box-shadow: 0 12px 24px rgba(13,110,253,.3); 
}

.time-overlay { 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,.4); 
    display: none; 
    align-items: flex-end; 
    z-index: 1056; 
}

.time-overlay.active { 
    display: flex; 
}

.time-overlay .sheet { 
    background: #fff; 
    width: 100%; 
    max-height: 70vh; 
    border-top-left-radius: 16px; 
    border-top-right-radius: 16px; 
    box-shadow: 0 -8px 24px rgba(0,0,0,.2); 
    padding: 12px; 
    overflow: auto; 
    position: relative; 
}

.time-overlay .header { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    margin-bottom: 8px; 
    position: sticky; 
    top: -15px; 
    background: #fff; 
    padding-bottom: 8px; 
    z-index: 2; 
}

.time-overlay .footer { 
    position: sticky; 
    bottom: 0; 
    background: #fff; 
    padding-top: 8px; 
    border-top: 1px solid #eee; 
    display: flex; 
    justify-content: flex-end; 
    z-index: 2; 
}

/* Стили для валидации */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    background-color: #fff5f5;
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-group.has-error .form-control {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-group.has-error .form-label {
    color: #dc3545;
    font-weight: 600;
}

.form-group.has-error .error-icon {
    color: #dc3545;
    font-size: 1.2rem;
    margin-left: 8px;
}

.form-group.has-error .error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 4px;
    font-weight: 500;
}

.form-control.is-invalid {
    animation: shake 0.5s ease-in-out;
}

/* Desktop адаптация */
@media (min-width: 768px) {
    .time-overlay { 
        align-items: center; 
        justify-content: center; 
    }
    
    .time-overlay .sheet { 
        width: 90%; 
        max-width: 600px; 
        max-height: 80vh; 
        border-radius: 16px; 
        box-shadow: 0 20px 40px rgba(0,0,0,.3); 
        padding: 20px; 
    }
    
    .time-overlay .header { 
        position: static; 
        margin-bottom: 16px; 
    }
    
    .time-overlay .footer { 
        position: static; 
        margin-top: 16px; 
    }
    
    .time-overlay #touchTimeline { 
        max-height: 400px; 
        overflow-y: auto; 
        border: 1px solid #eee; 
        border-radius: 8px; 
        padding: 8px; 
    }
    
    .fab-reserve .btn { 
        padding: 16px 24px; 
        font-size: 18px; 
    }
}

@media (max-width: 576px) {
    .modal-body { 
        padding: 12px; 
    }
    
    .btn-toggle .btn { 
        min-width: auto; 
    }
    
    .slot { 
        padding: 12px 12px; 
    }
    
    .slot .time { 
        font-size: 15px; 
    }
    
    .rooms-grid { 
        grid-template-columns: 1fr 1fr; 
    }
}

@media (prefers-reduced-motion: reduce) {
    .room-tile, .timeline, .slot.selected { 
        animation: none; 
        transition: none; 
    }
}

@keyframes fadeSlideUp { 
    from { 
        opacity: 0; 
        transform: translateY(6px); 
    } 
    to { 
        opacity: 1; 
        transform: translateY(0); 
    } 
}

@keyframes pulseSelect { 
    0% { 
        box-shadow: inset 0 0 0 rgba(13,110,253,0); 
    } 
    50% { 
        box-shadow: inset 0 0 12px rgba(13,110,253,.25); 
    } 
    100% { 
        box-shadow: inset 0 0 0 rgba(13,110,253,0); 
    } 
}

@keyframes shake {
    0%, 100% { 
        transform: translateX(0); 
    }
    25% { 
        transform: translateX(-5px); 
    }
    75% { 
        transform: translateX(5px); 
    }
}

/* Стили для неавторизованного пользователя */
.guest-info {
    padding: 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.guest-avatar {
    position: relative;
}

.guest-avatar::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    z-index: -1;
}

/* Стили для кнопки Google */
.google-login-btn {
    background: #fff;
    color: #333;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    min-width: 200px;
}

.google-login-btn:hover {
    background: #f8f9fa;
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.google-login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.google-login-btn svg {
    flex-shrink: 0;
}

/* Анимация для аватара гостя */
.guest-avatar {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 576px) {
    .guest-info {
        padding: 15px;
    }
    
    .google-login-btn {
        min-width: 180px;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .guest-avatar {
        width: 50px !important;
        height: 50px !important;
    }
    
    .guest-avatar i {
        font-size: 1.5rem !important;
    }
}