/* Zemex Ideal Day Section Component */

.zemex-ideal-day {
    position: relative;
    width: 100%;
    min-height: 1000px;
    padding: 120px 72px 80px;
    overflow: hidden;
}

/* Динамический заблюренный фон */
.zemex-ideal-day-bg {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(15px);
    transform: scale(1.05);
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    z-index: 0;
}

.zemex-ideal-day-bg.active {
    opacity: 1;
}

.zemex-ideal-day-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(40, 36, 33, 0.5);
    z-index: 1;
}

.zemex-ideal-day-container {
    position: relative;
    z-index: 2;
    max-width: 1776px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Title */
.zemex-ideal-day-title {
    font-family: 'TT Wellingtons', 'Gilroy', sans-serif;
    font-weight: 600;
    font-size: 40px;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: #ffffff;
    text-align: center;
    margin: 0 0 48px 0;
}

/* Content wrapper */
.zemex-ideal-day-content {
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
    margin-bottom: 48px;
}

/* Arrows */
.zemex-ideal-day-arrow {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.zemex-ideal-day-arrow:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Card */
.zemex-ideal-day-card {
    flex: 1;
    background: #1A221E;
    border-radius: 40px;
    padding: 48px;
    overflow: hidden;
}

.zemex-ideal-day-slides {
    position: relative;
    min-height: 500px;
}

.zemex-ideal-day-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 48px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.zemex-ideal-day-slide.active {
    position: relative;
    opacity: 1;
    visibility: visible;
}

/* Text section */
.zemex-ideal-day-text {
    flex: 0 0 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 0;
}

.zemex-ideal-day-slide-title {
    font-family: 'TT Wellingtons', 'Gilroy', sans-serif;
    font-weight: 600;
    font-size: 32px;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: #ffffff;
    margin: 0 0 28px 0;
    font-variant-numeric: lining-nums tabular-nums;
    font-feature-settings: "lnum" 1, "tnum" 1;
}

.zemex-ideal-day-slide-desc {
    font-family: 'TT Wellingtons', 'Gilroy', sans-serif;
    font-weight: 600;
    font-size: 18px;
    line-height: 1.8;
    color: #A3A5AA;
    margin: 0 0 auto 0;
}

.zemex-ideal-day-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    background: linear-gradient(180deg, #16D129 0%, #11B43A 100%);
    border-radius: 16px;
    font-family: 'TT Wellingtons', 'Gilroy', sans-serif;
    font-weight: 600;
    font-size: 18px;
    line-height: 32px;
    letter-spacing: 0.01em;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: 32px;
}

.zemex-ideal-day-btn:hover {
    background: linear-gradient(180deg, #1AE030 0%, #13C840 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(22, 209, 41, 0.3);
}

/* Gallery */
.zemex-ideal-day-gallery {
    flex: 1;
    display: flex;
    gap: 24px;
    height: 460px;
}

.zemex-ideal-day-gallery-main {
    flex: 1;
    border-radius: 24px;
    overflow: hidden;
}

.zemex-ideal-day-gallery-main a {
    display: block;
    width: 100%;
    height: 100%;
}

.zemex-ideal-day-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.zemex-ideal-day-gallery-main a:hover img {
    transform: scale(1.02);
}

.zemex-ideal-day-gallery-side {
    width: 288px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.zemex-ideal-day-gallery-small {
    flex: 1;
    border-radius: 24px;
    overflow: hidden;
}

.zemex-ideal-day-gallery-small a {
    display: block;
    width: 100%;
    height: 100%;
}

.zemex-ideal-day-gallery-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.zemex-ideal-day-gallery-small a:hover img {
    transform: scale(1.05);
}

/* Timeline */
.zemex-ideal-day-timeline {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(110, 115, 129, 0.6) 0%, rgba(90, 94, 99, 0.6) 100%);
    border-radius: 100px;
    padding: 16px 20px;
    gap: 16px;
}

.zemex-ideal-day-timeline-item {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #898989;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zemex-ideal-day-timeline-item:hover {
    color: #ffffff;
}

.zemex-ideal-day-timeline-item.active {
    color: #00BF3F;
}

.zemex-ideal-day-timeline-line {
    width: 310px;
    height: 2px;
    background: #898989;
    transition: background 0.3s ease;
}

.zemex-ideal-day-timeline-line.active {
    background: #00BF3F;
}

/* Responsive - Tablet */
@media (max-width: 1200px) {
    .zemex-ideal-day {
        padding: 80px 40px 60px;
        min-height: auto;
    }
    
    .zemex-ideal-day-title {
        font-size: 32px;
    }
    
    .zemex-ideal-day-card {
        padding: 32px;
        border-radius: 32px;
    }
    
    .zemex-ideal-day-slide {
        flex-direction: column;
    }

    .zemex-ideal-day-text {
        flex: none;
    }

    .zemex-ideal-day-gallery {
        height: 350px;
    }
    
    .zemex-ideal-day-gallery-side {
        width: 200px;
    }
    
    .zemex-ideal-day-timeline-line {
        width: 150px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .zemex-ideal-day {
        padding: 52px 16px 48px;
        min-height: auto;
    }
    
    .zemex-ideal-day-title {
        font-size: 24px;
        font-weight: 600;
        line-height: 26.4px;
        letter-spacing: -0.24px;
        margin-bottom: 32px;
        text-align: left;
    }
    
    .zemex-ideal-day-content {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 24px;
    }
    
    .zemex-ideal-day-arrow {
        display: none;
    }
    
    .zemex-ideal-day-card {
        padding: 24px;
        border-radius: 28px;
        width: 100%;
        background: #1a221e;
    }
    
    .zemex-ideal-day-slide {
        flex-direction: column;
    }

    .zemex-ideal-day-text {
        text-align: left;
        align-items: flex-start;
        padding: 0;
        margin-bottom: 24px;
    }
    
    .zemex-ideal-day-slide-title {
        font-size: 20px;
        font-weight: 600;
        line-height: 24px;
        letter-spacing: -0.2px;
        margin-bottom: 12px;
    }
    
    .zemex-ideal-day-slide-desc {
        font-size: 12px;
        font-weight: 500;
        line-height: 17.76px;
        letter-spacing: 0;
        color: #ffffff;
    }
    
    .zemex-ideal-day-gallery {
        flex-direction: column;
        height: auto;
        gap: 8px;
    }
    
    .zemex-ideal-day-gallery-main {
        height: 160px;
        border-radius: 26px;
    }
    
    .zemex-ideal-day-gallery-side {
        width: 100%;
        flex-direction: row;
        gap: 8px;
    }
    
    .zemex-ideal-day-gallery-small {
        height: 80px;
        border-radius: 12px;
    }
    
    .zemex-ideal-day-timeline {
        padding: 8px;
        gap: 4px;
        background: rgba(110, 115, 129, 0.6);
        border-radius: 100px;
        width: fit-content;
        margin: 0 auto;
    }
    
    .zemex-ideal-day-timeline-item {
        width: 24px;
        height: 24px;
    }
    
    .zemex-ideal-day-timeline-item svg {
        width: 18px;
        height: 18px;
    }
    
    .zemex-ideal-day-timeline-line {
        width: 62px;
        height: 1px;
    }
    
    .zemex-ideal-day-btn {
        width: 100%;
        padding: 12px 24px;
        font-size: 16px;
        font-weight: 600;
        line-height: 16px;
        letter-spacing: 0.16px;
        background: #06ac3e;
        border-radius: 12px;
        margin-top: 24px;
    }
    
    .zemex-ideal-day-btn:hover {
        background: #00bf3f;
    }
}

/* Icon Animation */

/* Будильник - дребезжание */
@keyframes alarmShake {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(-8deg); }
    20% { transform: rotate(8deg); }
    30% { transform: rotate(-6deg); }
    40% { transform: rotate(6deg); }
    50% { transform: rotate(-4deg); }
    60% { transform: rotate(4deg); }
    70% { transform: rotate(-2deg); }
    80% { transform: rotate(2deg); }
    90% { transform: rotate(0deg); }
}

@keyframes bellsRing {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-1px) rotate(-3deg); }
    75% { transform: translateY(-1px) rotate(3deg); }
}

/* Солнце - вращение лучей */
@keyframes sunRaysRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes sunCorePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

/* Луна - плавное покачивание и свечение */
@keyframes moonRock {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

@keyframes moonGlow {
    0%, 100% { filter: drop-shadow(0 0 2px currentColor); }
    50% { filter: drop-shadow(0 0 6px currentColor); }
}

.zemex-ideal-day-timeline-item {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.zemex-ideal-day-timeline-item:hover {
    transform: scale(1.15);
}

/* Луна чуть меньше для визуального баланса */
.zemex-ideal-day-timeline-item .icon-moon {
    transform: scale(0.9);
}

/* Анимации при активном состоянии */
.zemex-ideal-day-timeline-item.active .icon-alarm {
    animation: alarmShake 0.6s ease-in-out;
}

.zemex-ideal-day-timeline-item.active .icon-alarm .alarm-bells {
    animation: bellsRing 0.3s ease-in-out 3;
    transform-origin: center top;
}

.zemex-ideal-day-timeline-item.active .icon-sun .sun-rays {
    animation: sunRaysRotate 8s linear infinite;
    transform-origin: center;
}

.zemex-ideal-day-timeline-item.active .icon-sun .sun-core {
    animation: sunCorePulse 2s ease-in-out infinite;
    transform-origin: center;
}

.zemex-ideal-day-timeline-item.active .icon-moon {
    animation: moonRock 3s ease-in-out infinite, moonGlow 2s ease-in-out infinite;
    transform-origin: center;
}

/* Line animation */
.zemex-ideal-day-timeline-line {
    position: relative;
    overflow: hidden;
}

.zemex-ideal-day-timeline-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, #00bf3f 50%, transparent 100%);
    transition: left 0.5s ease-out;
}

.zemex-ideal-day-timeline-line.active::after {
    left: 100%;
}

/* Slide transition animation */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile specific animations */
@media (max-width: 768px) {
    .zemex-ideal-day-timeline-item.active svg {
        filter: drop-shadow(0 0 6px rgba(0, 191, 63, 0.4));
    }

    /* Упрощаем анимации на мобильных для производительности */
    .zemex-ideal-day-timeline-item.active .icon-sun .sun-rays {
        animation: sunRaysRotate 12s linear infinite;
    }

    .zemex-ideal-day-timeline-item.active .icon-moon {
        animation: moonRock 4s ease-in-out infinite;
    }
}

/* ===== GALLERY VIEWER ===== */
.zemex-gallery-viewer {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.zemex-gallery-viewer.active {
    opacity: 1;
    visibility: visible;
}

.zemex-gallery-viewer__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.zemex-gallery-viewer__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.zemex-gallery-viewer__close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.zemex-gallery-viewer__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.zemex-gallery-viewer__nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.zemex-gallery-viewer__prev {
    left: 20px;
}

.zemex-gallery-viewer__next {
    right: 20px;
}

.zemex-gallery-viewer__container {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zemex-gallery-viewer__img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    animation: galleryZoomIn 0.3s ease;
}

@keyframes galleryZoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.zemex-gallery-viewer__counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    z-index: 10;
}

/* Мобильные стили */
@media (max-width: 768px) {
    .zemex-gallery-viewer__close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }

    .zemex-gallery-viewer__nav {
        width: 44px;
        height: 44px;
    }

    .zemex-gallery-viewer__prev {
        left: 8px;
    }

    .zemex-gallery-viewer__next {
        right: 8px;
    }

    .zemex-gallery-viewer__container {
        max-width: 95vw;
        max-height: 80vh;
    }

    .zemex-gallery-viewer__img {
        max-height: 80vh;
        border-radius: 4px;
    }

    .zemex-gallery-viewer__counter {
        bottom: 12px;
        font-size: 12px;
    }
}

/* iOS safe area */
@supports (padding-top: env(safe-area-inset-top)) {
    .zemex-gallery-viewer__close {
        top: calc(12px + env(safe-area-inset-top));
    }
}

/* Accessibility */
.zemex-ideal-day-arrow:focus-visible,
.zemex-ideal-day-timeline-item:focus-visible,
.zemex-ideal-day-btn:focus-visible {
    outline: 2px solid #00BF3F;
    outline-offset: 4px;
}
