:root {
    --bg-color: #fdf9f6; /* Soft cream background */
    --card-color: #ffffff;
    --text-color: #4a4a4a;
    --primary-color: #d8a7b1; /* Dusty Rose */
    --secondary-color: #8d8d8d;
    --font-main: 'Nunito Sans', sans-serif;
    --font-headings: 'Playfair Display', serif;
}

body {
    font-family: var(--font-main);
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
    line-height: 1.6;
}

/* --- Video Background & Hero --- */
.hero-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url('../media/video/2.gif');
    background-size: cover;
    background-position: center center;
}

.hero-background::after {
    object-fit: cover;
}
.hero-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.55);
}

.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
    padding: 20px;
}

.hero-content h1 {
    font-family: var(--font-headings);
    font-size: clamp(2.2rem, 7vw, 4rem);
    margin: 0 0 10px 0;
    color: #fff;
}

.main-title-small {
    font-size: clamp(1.8rem, 5vw, 3rem) !important;
}

.hero-content p {
    font-size: clamp(1rem, 4vw, 1.5rem);
    color: #e0e0e0;
    margin-bottom: 30px;
}

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.cta-button:hover {
    transform: scale(1.05);
    background-color: #c38e9a;
}

/* --- Main Content --- */
.content-wrapper {
    background-color: var(--bg-color);
    padding: 60px 20px;
    position: relative;
    z-index: 2;
}

main section {
    max-width: 850px;
    margin: 0 auto 80px auto;
    text-align: center;
}

main section:not(:first-child) {
    padding-top: 40px;
    border-top: 1px solid #e0e0e0;
}

main h2 {
    font-family: var(--font-headings);
    font-size: clamp(2rem, 5vw, 2.5rem);
    color: var(--text-color);
    margin-bottom: 20px;
    line-height: 1.3;
}

.about-section .about-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    text-align: left;
}

@media (min-width: 768px) {
    .about-section .about-content {
        flex-direction: row;
        gap: 40px;
    }
}

.avatar-container {
    flex-shrink: 0;
}

.avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--card-color);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.about-section h2 {
    text-align: left;
    font-size: 1.8rem;
}

.about-section p {
    color: var(--secondary-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
    text-align: left;
}

.feature-card {
    background-color: var(--card-color);
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

.feature-card h3 {
    margin-top: 0;
    font-family: var(--font-headings);
    font-size: 1.4rem;
    color: var(--text-color);
}

.feature-card p {
    color: var(--secondary-color);
    font-size: 0.95rem;
}

.testimonial-video-wrapper {
    position: relative;
    max-width: 320px;
    margin: 20px auto 0;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 8px solid #333;
    background-color: #333;
}

.testimonial-video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
}

.video-sound-toggle {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.testimonial-video-wrapper:hover .video-sound-toggle {
    opacity: 1;
}

.video-sound-toggle .unmuted-icon { display: none; }
.video-sound-toggle.unmuted .muted-icon { display: block; }
.video-sound-toggle.unmuted .unmuted-icon { display: none; }
.video-sound-toggle:not(.unmuted) .muted-icon { display: none; }
.video-sound-toggle:not(.unmuted) .unmuted-icon { display: block; }

/* --- Final CTA & Booking Section --- */
#final-cta {
    position: relative;
    padding: 120px 20px;
    overflow: hidden;
    background-image: url('../media/video/4.gif');
    background-size: cover;
    background-position: center top;
    color: #fff;
    width: 100%;
    max-width: none;
    margin-bottom: 0;
}

#final-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(26, 26, 26, 0.7);
    z-index: 1;
}

#booking {
    background-color: var(--bg-color);
    padding-top: 60px;
    border-top: none;
    position: relative;
    z-index: 3;
}

#booking h2 {
    color: var(--text-color);
}

/* --- Booking Form (ported from consultation-booking) --- */
.booking-form {
    background-color: var(--card-color);
    border-radius: 12px;
    padding: 30px;
    text-align: left;
    max-width: 600px;
    margin: 20px auto 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

#final-cta h2, #final-cta p {
    position: relative;
    z-index: 2;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background-color: #f4f4f4;
    color: var(--text-color);
    font-family: var(--font-main);
    box-sizing: border-box;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 15px;
    flex-direction: column-reverse;
}

@media (min-width: 600px) {
    .form-actions {
        flex-direction: row;
    }
}

.submit-btn, .secondary-btn {
    width: 100%;
    padding: 15px 20px;
    border-radius: 6px;
    font-weight: bold;
    border: 1px solid var(--primary-color);
    cursor: pointer;
    font-size: 1.1rem;
    font-family: var(--font-main);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.submit-btn {
    background-color: var(--primary-color);
    color: #fff;
}
.submit-btn:hover {
    background-color: #c38e9a;
    border-color: #c38e9a;
}
.submit-btn:disabled {
    background-color: #555;
    border-color: #555;
    cursor: not-allowed;
}

.secondary-btn {
    background-color: transparent;
    color: var(--primary-color);
}
.secondary-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* --- Admin Panel --- */
.admin-panel-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 998;
    transition: transform 0.3s ease;
}
.admin-panel-toggle:hover {
    transform: scale(1.1);
}
.admin-panel-toggle svg {
    width: 28px;
    height: 28px;
}

.admin-panel {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 90%;
    max-width: 480px;
    background-color: #fdfdfd;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    z-index: 999;
    border: 1px solid #ddd;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}
.admin-panel.visible {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}
.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f0f0f0;
    border-bottom: 1px solid #ddd;
}
.admin-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}
.close-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}
.close-btn:hover {
    color: var(--text-color);
}
.admin-panel-tabs {
    display: flex;
    background-color: #f0f0f0;
}
.tab-link {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 1rem;
    border-bottom: 3px solid transparent;
    transition: color 0.3s, border-color 0.3s;
}
.tab-link:hover {
    color: var(--text-color);
}
.tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
.admin-panel-content {
    padding: 20px;
    max-height: 50vh;
    overflow-y: auto;
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}
.stat-card {
    background-color: #f0f0f0;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}
.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}
.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
}
.stats-hint {
    font-size: 0.8rem;
    color: #8d8d8d;
    text-align: center;
    margin-top: 10px;
}

.integration-test-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.integration-test-buttons button {
    flex-grow: 1;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
}
.image-upload-group {
    margin-bottom: 20px;
}

.image-upload-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.image-preview-container {
    position: relative;
    width: 100px;
    height: 100px;
}

.avatar-preview {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #555;
}

.image-upload-label {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.image-upload-label:hover {
    background-color: var(--primary-color);
}

/* --- Notification Popup (ported and restyled) --- */
.notification-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #0e1621; /* Telegram-like */
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    transform: translateX(calc(100% + 30px));
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    visibility: hidden;
}
.notification-popup.visible {
    transform: translateX(0);
    visibility: visible;
}
.notification-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.notification-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}
.notification-header .notification-bot-name {
    font-weight: bold;
    color: #fff;
}
.notification-message {
    background-color: #1f2c3a;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.95rem;
    line-height: 1.5;
}
.notification-popup .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
}

.notification-popup.light-style {
    background-color: #f2f2f2;
}
.notification-popup.light-style .notification-header .notification-bot-name,
.notification-popup.light-style .close-btn {
    color: #333;
}
.notification-popup.light-style .notification-message {
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.notification-popup.crm-style {
    background-color: #2c3e50; /* A neutral dark blue */
}

@media (max-width: 480px) {
    .notification-popup {
        width: 100%;
        max-width: 100%;
        top: 0;
        right: 0;
        left: 0;
        border-radius: 0;
        padding: 15px;
        transform: translateY(-150%);
    }

    .notification-popup.visible {
        transform: translateY(0);
    }
}

/* --- Оптимизации для мобильных устройств --- */
@media (max-width: 768px) {
    /*
     * Для мобильных устройств заменяем тяжелые GIF-анимации на статичные изображения или фон.
     * Это значительно улучшает производительность, скорость загрузки и экономит трафик.
    */
    .hero-background {
        background-image: url('../media/video/2.gif');
        /* position: absolute может работать лучше на некоторых мобильных устройствах, чем fixed, предотвращая "прыжки" при скролле */
        position: absolute;
    }

    #final-cta {
        background-image: none;
        background-image: url('../media/video/4.gif');
        background-color: #333; /* Можно использовать цвет из палитры, например var(--text-color) */
    }
}