/* Загальні стилі */
:root {
    --bg-color: #f8f8f8;
    --bg-color-rgb: 248, 248, 248;
    --text-color: #333;
    --bg-secondary: white;
    --bg-accent: #f5f5f5;
    --btn-bg: #333;
    --btn-color: white;
    --btn-hover: #555;
    --header-shadow: rgba(0, 0, 0, 0.1);
    --header-bg-transparent: rgba(0, 0, 0, 0.3);
    --header-bg-solid: #1a1a1a; /* Темний колір для хедера в світлій темі */
    --header-text: white;
    --border-color: #ddd;
    --footer-bg: #333;
    --footer-color: white;
    --modal-bg: rgba(0, 0, 0, 0.9);
    --modal-color: white;
    --transition-time: 0.3s;
}

.dark-theme {
    --bg-color: #121212;
    --bg-color-rgb: 18, 18, 18;
    --text-color: #e0e0e0;
    --bg-secondary: #1e1e1e;
    --bg-accent: #2a2a2a;
    --btn-bg: #4a4a4a;
    --btn-hover: #666;
    --header-shadow: rgba(0, 0, 0, 0.3);
    --header-bg-transparent: rgba(255, 255, 255, 0.3);
    --header-bg-solid: #e0e0e0; /* Світлий колір для хедера в темній темі */
    --header-text: #1a1a1a;
    --border-color: #444;
    --footer-bg: #1a1a1a;
    --footer-color: #e0e0e0;
    --modal-bg: rgba(0, 0, 0, 0.95);
    --modal-color: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color var(--transition-time), color var(--transition-time);
}

a {
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    padding: 0 40px; /* Більший відступ від країв */
}

/* Хедер */
header {
    padding: 20px 0;
    background-color: var(--header-bg-transparent); /* Використовуємо змінну */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

/* Клас для хедера при прокрутці */
header.scrolled {
    background-color: var(--header-bg-solid); /* Використовуємо змінну */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

header .logo,
header .nav-menu a {
    color: var(--header-text); /* Використовуємо змінну */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.nav-menu a:hover {
    color: rgba(255, 255, 255, 0.8);
}

.nav-menu a::after {
    background-color: white;
}

.flag-icon {
    width: 24px;
    height: 24px;
    border-radius: 2px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 30px
}

.theme-toggle, .lang-toggle {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.3s ease, opacity 0.3s ease; /* Додаємо перехід для трансформації */
}

.lang-toggle img {
    width: 20px;
    height: 20px;
    border-radius: 0; /* Видаляємо скруглення */
    background-color: transparent; /* Прозорий фон для самих зображень */
}

/* Light theme (default): show moon, hide sun */
.theme-toggle .light-icon {
    display: block;
}

.theme-toggle .dark-icon {
    display: none;
}

/* Dark theme: hide moon, show sun */
.dark-theme .theme-toggle .light-icon {
    display: none;
}

.dark-theme .theme-toggle .dark-icon {
    display: block;
}

/* Ефект при наведенні */
.theme-toggle:hover .theme-icon {
    transform: rotate(30deg);
    transition: all 0.2s ease;
}

.theme-toggle:hover, .lang-toggle:hover {
    opacity: 0.8;
    background-color: transparent;
    transform: scale(1.3); /* Збільшення при наведенні */
}

.theme-toggle {
    color: var(--header-text);
}

.logo {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li {
    margin-left: 30px;
}

.nav-menu a {
    font-size: 16px;
    position: relative;
}

.nav-menu a:hover {
    color: var(--header-text); /* Використовуємо ту ж змінну */
    opacity: 0.8; /* Додаємо невелику прозорість для ефекту при наведенні */
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--header-text);
    bottom: -5px;
    left: 0;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    cursor: pointer;
    font-size: 20px;
    color: white;
    color: var(--header-text);
}

/* Головна секція */
/* Головна секція */
.hero {
    width: 100%;
    height: auto;
    position: relative;
    overflow: visible;
    padding-top: 0;
    margin-top: 0;
}

/* Зображення героя */
.hero-image {
    width: 100%;
    height: auto;
    display: block;
    margin-top: 0;
}

/* Контейнер з текстом - ефект матового скла */
.hero-text-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px 0;
    background-color: rgba(0, 0, 0, 0.3); /* Збільшена непрозорість фону для кращої контрастності */
    backdrop-filter: blur(15px); /* Сильний блюр для ефекту матового скла */
    -webkit-backdrop-filter: blur(15px); /* Для Safari */
    z-index: 2;
    border-top: 1px solid rgba(255, 255, 255, 0.15); /* Трохи яскравіша лінія */
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
    /* Внутрішня тінь для додаткової глибини */
}

/* Підіймаємо вміст контейнера вище */
.hero-content {
    position: relative;
    z-index: 4;
    text-align: center;
    padding: 0 20px;
    max-width: 800px;
    margin: -20px auto 0; /* Негативний margin зверху для підняття контенту */
}

/* Зменшуємо розмір шрифту для заголовка щоб він не займав стільки місця */
.hero-content h1 {
    font-size: 3rem; /* Трохи зменшуємо розмір */
    margin-bottom: 15px; /* Зменшуємо відступ знизу */
    font-weight: 300;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    color: white;
    animation: fadeInUp 0.8s ease forwards;
}

/* Зменшуємо розмір і відступи для тексту опису */
.hero-content p {
    font-size: 1.1rem; /* Зменшуємо розмір шрифту */
    line-height: 1.5;
    margin-bottom: 20px; /* Зменшуємо відступ знизу */
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    color: white;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease 0.3s forwards;
    opacity: 0;
}

/* Робимо кнопку меншою */
.hero-content .btn {
    padding: 12px 30px; /* Зменшуємо розміри кнопки */
    font-size: 1rem;
    letter-spacing: 1.2px;
    margin-top: 10px; /* Зменшуємо верхній відступ */
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeInUp 0.8s ease 0.6s forwards;
    opacity: 0;
}

.hero-content .btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Анімація для елементів */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn {
    display: inline-block;
    padding: 14px 35px;
    background-color: #333;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
}

.btn:hover {
    background-color: #555;
    transform: translateY(-3px);
}

/* Галерея */
.gallery {
    padding: 80px 0;
    position: relative;
    z-index: 3;
    background-color: var(--bg-color);
    margin-top: 80px; /* Додаємо відступ зверху */
}

/* Для плавного скролінга до секцій */
html {
    scroll-padding-top: 80px; /* Додаємо padding для скролу, щоб враховувати фіксований хедер */
    scroll-behavior: smooth;
}

.gallery-filter {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    margin: 0 10px 10px;
    padding: 8px 20px;
    background: none;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.filter-btn.active, .filter-btn:hover {
    background-color: var(--btn-bg);
    color: var(--btn-color);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.gallery-eye-icon {
    position: absolute;
    top: 0px;
    right: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    pointer-events: none; /* Робить іконку неклікабельною */
    z-index: 2;
}

.modal-eye-icon {
    position: absolute;
    top: 0px;
    right: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    pointer-events: none; /* Робить іконку неклікабельною */
    z-index: 2;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    height: 300px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;

    padding: 0 15px;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.gallery-overlay p {
    font-size: 14px;
}

/* Про художника */
.about {
    padding: 80px 0;
    background-color: var(--bg-secondary);
    transition: background-color var(--transition-time);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-image {
    height: 500px;
    overflow: hidden;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-text h2 {
    font-size: 36px;
    margin-bottom: 20px;
    font-weight: 300;
}

.about-text p {
    margin-bottom: 20px;
    color: var(--text-color);
    opacity: 1;
}

/* Стилі для вирівняної контактної секції */
.contact {
    padding: 40px 0;
    background-color: var(--bg-accent);
    transition: background-color var(--transition-time);
}

.section-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 36px;
    font-weight: 300;
}

.contact-content {
    display: flex;
    justify-content: center;
}

.contact-info {
    max-width: 400px; /* Обмежуємо ширину для кращого вирівнювання */
    text-align: center;
}

.contact-item {
    display: flex;
    align-items: flex-start; /* Вирівнюємо за верхнім краєм */
    margin-bottom: 20px;
    text-align: left;
}

/* Іконки контактів */
.contact-icon {
    margin-right: 15px; 
    flex-shrink: 0; /* Запобігає стисканню іконки */
    width: 40px; /* Фіксована ширина для вирівнювання */
}

.contact-icon i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #333;
    color: white;
    border-radius: 50%;
    font-size: 16px;
}

.contact-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Вирівнюємо текст за лівим краєм */
    width: calc(100% - 55px); /* Враховуємо ширину іконки і відступ */
    justify-content: center; /* Центруємо вміст вертикально */
}

.contact-text h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    width: 100%; /* Повна ширина для заголовка */
    line-height: 1.2; /* Зменшуємо висоту рядка для кращого вирівнювання */
}

.contact-text span {
    font-size: 15px;
    color: var(--text-color);
    opacity: 0.8;
    width: 100%; /* Повна ширина для тексту */
    line-height: 1.2; /* Зменшуємо висоту рядка для кращого вирівнювання */
}

/* Вирівнювання заголовка для соціальних мереж */
.contact-info > h4 {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    text-align: center; /* Центруємо текст "Слідкуйте за мною" */
}

/* Соціальні іконки */
.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #333;
    color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: #555;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.social-links a i {
    font-size: 16px;
}

/* Виправлення для іконки Telegram */
.social-links a i.fa-paper-plane {
    position: relative;
    transform: translateX(1px);
    top: -1px;
}

/* Футер */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-color);
    padding: 10px 0;
    text-align: center;
    transition: background-color var(--transition-time), color var(--transition-time);
}

/* Модальне вікно для галереї */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
  display: flex;
  width: 95%;
  max-width: 1400px;
  height: 85vh;
  max-height: 85vh;
  background-color: rgba(0, 0, 0, 0.9);
  position: relative;
  overflow: hidden; /* Гарантує, що вміст не виходитиме за межі */
  border-radius: 15px;
  overflow: visible;
}
.modal-content {
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  border-radius: 15px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
}

.modal-image-container {
  width: 60%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* Важливо для запобігання виходу за межі */
  padding: 0px;
}

.modal-image-wrapper {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.modal-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
}

.modal-thumbnails img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-thumbnails img:hover,
.modal-thumbnails img.active {
    border-color: white;
    transform: scale(1.1);
}

.modal-details {
  height: 100%;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  overflow-y: auto;
  width: calc(45% - 150px);
  padding-right: 80px
}

.modal-details > div:first-child {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}

.modal-details > div:last-child {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 20px;
}

.modal-details h2 {
   font-size: clamp(0.875rem, 2.5vw, 1.8rem);
   line-height: 1.2;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
   max-width: 100%;
}

.modal-details p {
    margin-bottom: 20px;
    line-height: 1.6;
    opacity: 0.8;
}

.modal-price {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

.modal-contact-btn {
    padding: 12px 30px;
    background-color: rgba(230, 102, 23, 1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    min-width: 200px;
}

.modal-contact-btn:hover {
    background-color: rgba(28, 130, 8, 0.3);
    transform: translateY(-3px);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: rotate(90deg);
    transition: all 0.2s ease;
}

.modal-caption {
    color: white;
    text-align: center;
    margin-top: 20px;
    padding: 0 20px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    font-size: 1.1rem;
}

.modal-nav button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-nav button:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.2);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--btn-bg);
    color: var(--btn-color);
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-links a:hover {
    background-color: var(--btn-hover);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Якщо використовуєте варіант 3 з зображеннями */
.social-links img {
    width: 20px;
    height: 20px;
}

/* Якщо використовуєте варіант 2 з SVG */
.social-links svg {
    width: 16px;
    height: 16px;
}

.social-links a i.fa-paper-plane {
    position: relative;
    transform: translateX(-1px); /* Зсув вправо */
    font-size: 90%;
}

.modal-control-button {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.modal-close {
    width: 40px;
    height: 40px;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1020;
}

.modal-close i,
.modal-prev i,
.modal-next i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 20px;
}

.modal-nav {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    z-index: 1010;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    padding: 0 10px; /* Зменшуємо відступи */
}

.modal-prev, .modal-next {
    width: 50px;
    height: 50px;
    position: relative; /* Змінюємо з fixed на relative */
    z-index: 1010;
    pointer-events: auto;
}

.modal-prev {
    margin-left: 10px;
}

.modal-next {
    margin-right: 10px;
}

.modal-nav button {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.modal-thumbnails {
  width: 80px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 10px 0px;
}

.modal-thumbnails::-webkit-scrollbar {
    width: 8px;
}

.modal-thumbnails::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.modal-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-thumbnails::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Стрілки скрол-бару (для webkit) */
.modal-thumbnails::-webkit-scrollbar-button {
    display: none;
}

/* Для Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.2);
}

.modal-specs {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

.modal-image-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  object-fit: contain !important;
  object-position: center !important;
  background-color: rgba(0, 0, 0, 0.95) !important;
  z-index: 2000 !important;
  cursor: zoom-out !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  transform: none !important;
  transition: none !important;
  display: block !important;
}

.gallery-item[data-id="6"] img {
  object-position: center 20%; /* Зміщуємо фокус зображення вгору */
}