/**
 * Дополнительные стили для лендинга
 * Основные стили генерируются Tailwind CSS
 */

/* =============================================
   Кастомный скроллбар
   ============================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    /* ЖЕСТКО баним горизонтальный скролл */
    width: 100%;
    position: relative;
}

html {
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #7A9559;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #627A45;
}

/* Тёмная тема скроллбара */
.dark ::-webkit-scrollbar-track {
    background: #1E1E1E;
}

.dark ::-webkit-scrollbar-thumb {
    background: #7A9559;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #8AB45F;
}

/* =============================================
   Модальные окна
   ============================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 28rem;
    width: 100%;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.dark .modal-content {
    background: #1E1E1E;
    color: #E0E0E0;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #9CA3AF;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #374151;
}

.dark .modal-close:hover {
    color: #E0E0E0;
}

/* =============================================
   Уведомления (Toast Notifications)
   ============================================= */

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55), opacity 0.3s ease;
    max-width: 22rem;
    border-left: 4px solid #7A9559;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left-color: #10B981;
}

.toast.error {
    border-left-color: #EF4444;
}

.toast.warning {
    border-left-color: #F59E0B;
}

.toast-icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
}

.toast.success .toast-icon {
    color: #10B981;
}

.toast.error .toast-icon {
    color: #EF4444;
}

.toast.warning .toast-icon {
    color: #F59E0B;
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    color: #374151;
}

.dark .toast {
    background: #1E1E1E;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.dark .toast-message {
    color: #E0E0E0;
}

/* =============================================
   Honeypot поле (невидимое для пользователей)
   ============================================= */

.honeypot-field {
    position: absolute !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* =============================================
   Состояния кнопок форм
   ============================================= */

.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin-top: -0.5rem;
    margin-left: -0.5rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-loading span {
    visibility: hidden;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* =============================================
   Мобильное меню
   ============================================= */

.mobile-menu {
    position: fixed;
    top: 5rem;
    left: 0;
    right: 0;
    background: white;
    padding: 1.5rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 40;
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.dark .mobile-menu {
    background: #1E1E1E;
}

.mobile-menu a {
    display: block;
    padding: 0.75rem 0;
    color: #374151;
    font-weight: 500;
    transition: color 0.2s ease;
}

.mobile-menu a:hover {
    color: #7A9559;
}

.dark .mobile-menu a {
    color: #D1D5DB;
}

/* =============================================
   Ошибки валидации форм
   ============================================= */

.form-field-error {
    border-color: #EF4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.form-error-message {
    color: #EF4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}

.form-error-message.visible {
    display: block;
}

/* =============================================
   Анимации
   ============================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* =============================================
   Модальное окно записи (Booking Modal)
   ============================================= */

#booking-modal .modal-content {
    position: relative;
    max-width: 32rem;
}

#booking-modal h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

#booking-modal form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#booking-modal input,
#booking-modal select,
#booking-modal textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#booking-modal input:focus,
#booking-modal select:focus,
#booking-modal textarea:focus {
    outline: none;
    border-color: #7A9559;
    box-shadow: 0 0 0 3px rgba(122, 149, 89, 0.2);
}

.dark #booking-modal input,
.dark #booking-modal select,
.dark #booking-modal textarea {
    background: #121212;
    border-color: #374151;
    color: #E0E0E0;
}

.dark #booking-modal input::placeholder,
.dark #booking-modal select::placeholder,
.dark #booking-modal textarea::placeholder {
    color: #6B7280;
}

#booking-modal button[type="submit"] {
    background: #7A9559;
    color: white;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

#booking-modal button[type="submit"]:hover {
    background: #68804a;
}

#booking-modal button[type="submit"]:active {
    transform: scale(0.98);
}

/* =============================================
   Анимации при прокрутке
   ============================================= */

.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}

.animate-on-scroll.fade-in {
    transform: translateY(30px);
}

.animate-on-scroll.fade-in-scale {
    transform: scale(0.95);
}

.animate-on-scroll.slide-in-left {
    transform: translateX(-50px);
}

.animate-on-scroll.slide-in-right {
    transform: translateX(50px);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

/* Задержки для последовательной анимации */
.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

.delay-400 {
    transition-delay: 0.4s;
}

.delay-500 {
    transition-delay: 0.5s;
}

/* =============================================
   Улучшение читаемости текста на hero
   ============================================= */

.hero-text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95),
        0 4px 8px rgba(0, 0, 0, 0.85),
        0 8px 16px rgba(0, 0, 0, 0.75),
        0 1px 2px rgba(0, 0, 0, 1);
}

/* =============================================
   Компактный выбор услуг (Compact Service Selector)
   ============================================= */

.service-selector {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    /* Минимальный отступ */
    margin-bottom: 1rem;
    max-height: 30vh;
    /* Ограничиваем высоту списка услуг, чтобы при 200 услугах был скролл внутри */
    overflow-y: auto;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.service-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    /* Компактные отступы */
    border: 1px solid transparent;
    /* Чтобы не скакало при выборе */
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.1s ease;
    background: white;
}

.service-option:hover {
    background: #F3F4F6;
}

.service-option.selected {
    background: #F0FDF4;
    /* Светло-зеленый фон */
    color: #166534;
    /* Темно-зеленый текст */
    font-weight: 500;
}

.dark .service-selector {
    border-color: #374151;
    background: #111827;
}

.dark .service-option {
    background: #111827;
    color: #E5E7EB;
}

.dark .service-option:hover {
    background: #1F2937;
}

.dark .service-option.selected {
    background: rgba(122, 149, 89, 0.2);
    color: #8bb85c;
}

.service-name {
    font-size: 0.9rem;
    line-height: 1.25;
}

.service-price {
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 1rem;
    white-space: nowrap;
}

/* Скрываем ненужный радио-кружок, делаем просто подсветку строки */
.service-radio {
    display: none;
}


/* =============================================
   Модальное окно политики
   ============================================= */

.privacy-content {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4B5563;
}

.dark .privacy-content {
    color: #D1D5DB;
}

.privacy-content p {
    margin-bottom: 1rem;
}

/* Custom scrollbar for content */
.privacy-content::-webkit-scrollbar {
    width: 6px;
}

.privacy-content::-webkit-scrollbar-track {
    background: transparent;
}

.privacy-content::-webkit-scrollbar-thumb {
    background-color: #D1D5DB;
    border-radius: 20px;
}

.dark .privacy-content::-webkit-scrollbar-thumb {
    background-color: #4B5563;
}
/* =============================================
   IMPORTANT: Modal Mobile Scroll Fix
   ============================================= */
.modal-content {
    max-height: 85vh !important;
    overflow-y: auto !important;
    display: flex;
    flex-direction: column;
}
