/* ===========================
   3D ANIMATIONS WITH TRANSFORMS
   =========================== */

@keyframes slideInLeft {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px) rotateZ(0deg);
    }
    50% {
        transform: translateY(-20px) rotateZ(5deg);
    }
    100% {
        transform: translateY(0px) rotateZ(0deg);
    }
}

@keyframes rotate3d {
    from {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }
    to {
        transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes rotateIn {
    from {
        transform: rotateZ(-10deg) scale(0.9);
        opacity: 0;
    }
    to {
        transform: rotateZ(0deg) scale(1);
        opacity: 1;
    }
}

/* ===========================
   3D PERSPECTIVE EFFECTS
   =========================== */

.hero {
    perspective: 1000px;
}

.hero-content {
    transform-style: preserve-3d;
}

.direction-card {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.direction-card:hover {
    transform: translateY(-5px); /* Simplified hover for performance */
}

/* ===========================
   LANGUAGE NOTIFICATION
   =========================== */

.language-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #1a2a3a, #0f1f2f);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: translateX(200%) translateY(-50%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity 0.3s ease,
                background-color 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.language-notification.show {
    transform: translateX(0) translateY(0);
    opacity: 1;
    animation: slideInRight 0.4s ease-out;
}

/* ===========================
   LANGUAGE SWITCH ANIMATION
   =========================== */

[data-translate] {
    transition: opacity 0.15s ease-out !important;
}

/* ===========================
   CARD ANIMATIONS
   =========================== */

.direction-card, .partner-card, .step-card {
    animation: zoomIn 0.6s ease forwards;
    opacity: 0;
}

.direction-card:nth-child(1) {
    animation-delay: 0.1s;
}

.direction-card:nth-child(2) {
    animation-delay: 0.2s;
}

.direction-card:nth-child(3) {
    animation-delay: 0.3s;
}

/* ===========================
   INTERACTIVE ELEMENTS
   =========================== */

.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn:hover::before {
    left: 100%;
}

.product-item {
    position: relative;
    overflow: hidden;
}

.product-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.5s ease;
}

.product-item:hover::before {
    left: 100%;
}

/* ===========================
   SCROLL ANIMATIONS
   =========================== */

.section-title {
    animation: slideInUp 0.8s ease forwards;
    opacity: 0;
}

.about-text {
    animation: slideInLeft 0.8s ease forwards;
    opacity: 0;
}

.about-logo {
    animation: slideInRight 0.8s ease forwards;
    opacity: 0;
}

/* ===========================
   PARALLAX & DEPTH EFFECTS
   =========================== */

.hero-background {
    animation: float 20s ease-in-out infinite;
}

.trading-widget {
    animation: float 4s ease-in-out infinite;
    animation-delay: 0.5s;
}

/* ===========================
   GLOWING EFFECTS
   =========================== */

.logo-circle {
    animation: glow 2s ease-in-out infinite;
}

.logo-circle-large {
    animation: glow 3s ease-in-out infinite;
}

.accent-color {
    animation: pulse 2s ease-in-out infinite;
}

/* ===========================
   ADVANCED 3D TRANSFORMS
   =========================== */

@supports (transform: rotateX(45deg)) {
    .direction-card {
        transition: transform 0.3s cubic-bezier(0.23, 1, 0.320, 1);
    }

    .direction-card:hover {
        transform: translateY(-8px) scale(1.02); /* Simplified hover for performance */
    }
}

/* ===========================
   STAGGER ANIMATIONS
   =========================== */

.partner-card, .step-card {
    animation: zoomIn 0.5s ease-out forwards;
    opacity: 0;
}

.steps-grid .step-card:nth-child(1) { animation-delay: 0.1s; }
.steps-grid .step-card:nth-child(2) { animation-delay: 0.2s; }
.steps-grid .step-card:nth-child(3) { animation-delay: 0.3s; }
.steps-grid .step-card:nth-child(4) { animation-delay: 0.4s; }
.steps-grid .step-card:nth-child(5) { animation-delay: 0.5s; }
.steps-grid .step-card:nth-child(6) { animation-delay: 0.6s; }
.steps-grid .step-card:nth-child(7) { animation-delay: 0.7s; }
.steps-grid .step-card:nth-child(8) { animation-delay: 0.8s; }

.partners-grid .partner-card:nth-child(1) { animation-delay: 0.1s; }
.partners-grid .partner-card:nth-child(2) { animation-delay: 0.2s; }
.partners-grid .partner-card:nth-child(3) { animation-delay: 0.3s; }
.partners-grid .partner-card:nth-child(4) { animation-delay: 0.4s; }
.partners-grid .partner-card:nth-child(5) { animation-delay: 0.5s; }

.catalog-grid > * {
    animation: slideInUp 0.6s ease forwards;
    opacity: 0;
}

.catalog-grid > *:nth-child(1) {
    animation-delay: 0.1s;
}

.catalog-grid > *:nth-child(2) {
    animation-delay: 0.2s;
}

/* ===========================
   HOVER EFFECTS FOR DEPTH
   =========================== */

.product-item {
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
}

.product-item:hover {
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

/* ===========================
   LOADING ANIMATIONS
   =========================== */

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
}

/* ===========================
   WAVE ANIMATION
   =========================== */

@keyframes wave {
    0%, 100% {
        transform: translateY(0px);
    }
    25% {
        transform: translateY(-10px);
    }
    50% {
        transform: translateY(0px);
    }
    75% {
        transform: translateY(-5px);
    }
}

.wave-item {
    animation: wave 1s ease-in-out infinite;
}

/* ===========================
   BLUR ENTRANCE
   =========================== */

@keyframes blurIn {
    from {
        filter: blur(10px);
        opacity: 0;
    }
    to {
        filter: blur(0);
        opacity: 1;
    }
}

.blur-in {
    animation: blurIn 0.8s ease-out;
}

/* ===========================
   LANGUAGE SWITCH ANIMATION
   =========================== */

[data-translate] {
    transition: opacity 0.15s ease-out !important;
}

/* Скрываем элементы при смене языка */
.language-switching [data-translate] {
    opacity: 0;
}

/* Уведомление о смене языка */
.language-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #1a2a3a, #0f1f2f);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: translateX(200%) translateY(-50%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity 0.3s ease,
                background-color 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.language-notification.show {
    transform: translateX(0) translateY(0);
    opacity: 1;
    animation: slideInRight 0.4s ease-out;
}

/* Mobile Performance Optimization */
@media (max-width: 768px) {
    /* Disable complex 3D transforms on smaller screens for better performance */
    .direction-card:hover {
        transform: translateY(-5px) !important; /* Override 3D transform */
    }

    @supports (transform: rotateX(45deg)) {
        .direction-card:hover {
            transform: translateY(-5px) !important;
        }
    }

    /* Adjust language notification position for mobile */
    .language-notification {
        top: 10px;
        right: 10px;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}


@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
