:root {
    --primary-text-color: #222;
    --secondary-text-color: white;
    --background-dark: #222;
    --background-light: #f4f4f4;
    --transition-speed: 0.3s ease;
    --form-background: rgba(255, 255, 255, 0.1);
    --form-border: rgba(255, 255, 255, 0.3);
    --form-input-text: white;
    --form-placeholder-text: rgba(255, 255, 255, 0.7);
    --button-background: #ffcc00;
    --button-text: #222;
}

* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    height: 100%;

    background: url('../images/FanMailFon.CR2') no-repeat center center fixed;
    background-size: cover;
    color: var(--secondary-text-color);
    line-height: 1.6;
}

/* Header тепер не потрібен, якщо language-switcher переміщено в nav */
/* header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 1000;
} */

nav {
    background-color: var(--background-dark);
    padding: 10px 20px;
    display: flex; /* Використовуємо flexbox для компонування */
    justify-content: space-between; /* Розносимо елементи по краях */
    align-items: center;
    flex-wrap: nowrap; /* Запобігаємо перенесенню елементів на великих екранах */
    position: sticky;
    top: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 990;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Кнопка-бургер */
.hamburger-menu {
    display: none; /* Приховуємо за замовчуванням на великих екранах */
    background: none;
    border: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
    padding: 10px;
    order: -1; /* Розміщуємо зліва на мобільних */
}

/* Група посилань навігації */
.nav-links-group {
    display: flex; /* За замовчуванням завжди flex для десктопу */
    gap: 15px;
    flex-wrap: wrap; /* Дозволяємо перенесення на новий рядок, якщо не влазять */
    justify-content: center;
    flex-grow: 1; /* Дозволяє займати доступний простір */
}

nav a {
    color: var(--secondary-text-color);
    text-decoration: none;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 20px;
    transition: background var(--transition-speed), box-shadow var(--transition-speed), color var(--transition-speed);
    white-space: nowrap;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    background-color: rgba(255, 255, 255, 0.01);
    border: none;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
    color: white;
}

nav a.active-link {
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
    color: white;
}

.language-switcher {
    display: flex;
    gap: 10px;
    /* Ці стилі були для .language-switcher в header, тепер вони будуть перевизначені медіа-запитами */
    /* position: absolute; */
    /* top: 20px; */
    /* right: 20px; */
    /* z-index: 10; */
}

.language-button {
    background: rgba(255, 255, 255, 0.01);
    border: none;
    color: white;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 20px;
    font-weight: bold;
    transition: background var(--transition-speed), box-shadow var(--transition-speed), color var(--transition-speed);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    text-decoration: none;
}

.language-button:hover {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.language-button.active {
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
    font-weight: bolder;
}

main {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 40px 20px;
    max-width: 800px;
    margin: 100px auto 30px auto;
    border-radius: 10px;
    text-align: center;
    /* margin-top: calc(70px + 20px); - Цей calc може бути проблемою, краще керувати margin-top через nav height */
    margin-top: 100px; /* Приблизне значення після висоти навбару */
    position: relative;
}

.forms-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 1200px;
    margin: 30px auto;
}

.content-section {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 40px 20px;
    border-radius: 10px;
    text-align: center;
    flex: 1;
    min-width: 300px;
    box-sizing: border-box;
}

.reviews-section {
    max-width: 800px;
    margin: 30px auto;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 40px 20px;
    border-radius: 10px;
    text-align: center;
}

.content-section h2 {
    color: var(--secondary-text-color);
    margin-bottom: 25px;
    font-size: 2em;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 100%;
    margin: 0 auto;
    text-align: left;
}

.contact-form label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
    width: calc(100% - 20px);
    padding: 10px;
    border: 1px solid var(--form-border);
    border-radius: 5px;
    background-color: var(--form-background);
    color: var(--form-input-text);
    font-size: 1em;
    transition: border-color var(--transition-speed), background-color var(--transition-speed);
}

.contact-form input[type="text"]::placeholder,
.contact-form input[type="email"]::placeholder,
.contact-form input[type="tel"]::placeholder,
.contact-form textarea::placeholder {
    color: var(--form-placeholder-text);
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form input[type="tel"]:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #ffcc00;
    background-color: rgba(255, 255, 255, 0.15);
}

.contact-form textarea {
    resize: vertical;
    min-height: 100px;
}

.contact-form button {
    background-color: var(--button-background);
    color: var(--button-text);
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color var(--transition-speed);
    margin-top: 10px;
}

.contact-form button:hover {
    background-color: #e6b800;
}

/* Styles for individual reviews */
.review-item {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
    position: relative; /* For photo positioning */
}

.review-item h3 {
    color: var(--button-background);
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.4em;
}

.review-item .review-date {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
    display: block;
}

.review-item p {
    margin-bottom: 15px;
}

.review-item .review-media { /* Unified class for photo/video */
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin-top: 10px;
    display: block; /* Ensures it takes up full width */
}

.reviews-section .disqus-placeholder {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    padding: 30px;
    margin: 20px auto;
    max-width: 600px;
    border-radius: 8px;
}
.reviews-section .disqus-placeholder p {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    font-size: 1.1em;
}

footer {
    background-color: var(--background-dark);
    color: var(--secondary-text-color);
    text-align: center;
    padding: 20px;
    position: relative;
    bottom: 0;
    width: 100%;
}

footer p {
    font-size: 0.85em;
}
.footer-small-text {
    font-size: 0.75em;
}

/* Медіа-запити */
@media (max-width: 1200px) {
    .forms-container {
        max-width: 800px;
    }
    .content-section {
        flex: 1 1 calc(50% - 20px);
        max-width: calc(50% - 10px);
    }
}

@media (max-width: 768px) {
    nav {
        flex-direction: row; /* Залишаємо в рядок, щоб бургер і мови були поруч */
        justify-content: space-between;
        padding: 10px 15px; /* Зменшуємо внутрішній відступ */
        flex-wrap: nowrap; /* Запобігаємо перенесенню елементів навбару */
    }

    .hamburger-menu {
        display: block; /* Показуємо кнопку-бургер */
    }

    .nav-links-group {
        display: none; /* Приховуємо посилання за замовчуванням */
        flex-direction: column; /* Елементи меню один під одним */
        width: 100%; /* Займає всю ширину */
        position: absolute;
        top: 60px; /* Висота навбару */
        left: 0;
        background-color: var(--background-dark);
        box-shadow: 0 5px 10px rgba(0,0,0,0.3);
        padding: 10px 0;
        overflow: hidden;
    }

    .nav-links-group.open {
        display: flex; /* Показуємо як flex-контейнер */
        animation: slideDown 0.3s ease-out forwards;
    }

    .nav-links-group.closing {
        animation: slideUp 0.3s ease-out forwards;
    }

    .nav-links-group a {
        text-align: center;
        padding: 12px 0;
        width: 100%;
        border-radius: 0; /* Прибираємо закруглення, якщо меню повне */
        background-color: transparent; /* Робимо фон прозорим у відкритому меню */
        box-shadow: none;
    }

    .language-switcher {
        position: static; /* Повертаємо в нормальний потік */
        display: flex;
        gap: 10px;
        margin-top: 0;
        order: 1; /* Розміщуємо мови праворуч від бургеру */
    }
    
    .language-button {
        padding: 6px 10px;
        font-size: 0.9em;
        border-radius: 15px;
        backdrop-filter: none; /* Прибираємо blur, якщо потрібно */
        -webkit-backdrop-filter: none;
    }

    main, .forms-container, .reviews-section {
        margin: 80px auto 20px auto;
        padding: 20px 15px;
    }
    .forms-container {
        flex-direction: column;
        align-items: center;
    }
    .content-section {
        padding: 25px 15px;
        min-width: unset;
        max-width: 90%;
        flex: 1 1 100%;
    }
    .content-section h2 {
        font-size: 1.8em;
    }
    .contact-form input,
    .contact-form textarea,
    .contact-form button {
        font-size: 0.95em;
    }
}

/* Анімація появи меню */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Анімація зникнення меню */
@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

@media (max-width: 480px) {
    main, .forms-container, .reviews-section {
        margin: 60px auto 15px auto;
        padding: 15px 10px;
    }
    nav a {
        font-size: 0.9em;
    }
    .content-section h2 {
        font-size: 1.5em;
    }
    .contact-form input,
    .contact-form textarea,
    .contact-form button {
        font-size: 0.9em;
    }
}