/**
 * ==========================================================================
 * VERDEX GROUP - Responsive Styles
 * ==========================================================================
 * 
 * V2: Адаптивные стили для всех размеров экрана
 * 
 * @version 2.0.0
 */

/* ========================================
 * LARGE DESKTOP (< 1400px)
 * ======================================== */

@media (max-width: 1400px) {
    :root {
        --container-max: 1200px;
    }
    
    .dashboard-preview {
        grid-template-columns: 180px 1fr 250px;
    }
}

/* ========================================
 * DESKTOP (< 1200px)
 * ======================================== */

@media (max-width: 1199px) {
    :root {
        --container-max: 960px;
    }

    .conditions__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .testimonials__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .testimonials__grid .testimonial-card:last-child {
        grid-column: span 2;
        max-width: 50%;
        margin: 0 auto;
    }
    
    .dashboard-preview {
        grid-template-columns: 160px 1fr 220px;
    }
}

/* ========================================
 * TABLET LANDSCAPE (< 992px)
 * ======================================== */

@media (max-width: 991px) {
    :root {
        --section-padding: var(--space-10);
    }

    /* Header */
    .header__nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 350px;
        height: 100vh;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        padding: var(--space-8);
        background: var(--color-bg-secondary);
        border-left: 1px solid var(--color-border);
        transition: right var(--transition-base);
        z-index: 5;
    }

    .header__nav.active {
        right: 0;
    }

    .header__nav-link {
        width: 100%;
        padding: var(--space-4);
        font-size: var(--text-lg);
    }

    .header__mobile-toggle {
        display: flex;
    }

    .header__actions .btn-ghost {
        display: none;
    }
    
    /* Language Switcher - Tablet */
    .lang-switcher__code {
        display: none;
    }
    
    .lang-switcher__toggle {
        padding: var(--space-2) var(--space-3);
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .lang-switcher__flag {
        font-size: 1.25rem;
    }
    
    .lang-switcher__dropdown {
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
    }
    
    .lang-switcher.active .lang-switcher__dropdown {
        transform: translateX(-50%) translateY(0);
    }

    /* Raw Spread */
    .raw-spread__content {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    /* Security Grid */
    .security__grid {
        grid-template-columns: 1fr;
    }

    /* Platform */
    .platform__content {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    /* Footer */
    .footer__main {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-6);
    }

    .footer__brand {
        grid-column: span 2;
        max-width: none;
    }
    
    /* Dashboard Preview */
    .dashboard-preview {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .dashboard-sidebar {
        display: none;
    }
    
    .swap-panel {
        display: none;
    }
    
    .dashboard-main {
        padding: var(--space-4);
    }
    
    /* Testimonials */
    .testimonials__grid {
        grid-template-columns: 1fr;
    }
    
    .testimonials__grid .testimonial-card:last-child {
        grid-column: span 1;
        max-width: none;
    }
}

/* ========================================
 * TABLET PORTRAIT (< 768px)
 * ======================================== */

@media (max-width: 767px) {
    :root {
        --container-padding: var(--space-4);
    }

    /* Hero */
    .hero {
        min-height: auto;
        padding-top: 100px;
        padding-bottom: var(--space-8);
    }

    .hero__title {
        font-size: var(--text-4xl);
    }

    /* Hide hero email form on mobile */
    .hero__cta {
        display: none;
    }

    /* Features Showcase */
    .features-showcase__grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .feature-item {
        padding: var(--space-5);
    }
    
    .feature-item__number {
        font-size: var(--text-3xl);
    }

    /* Conditions */
    .conditions__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .conditions__card {
        padding: var(--space-4);
    }

    /* TradingView Widget */
    .tradingview-widget {
        height: 300px;
    }

    /* CTA Full */
    .cta-full {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        padding: var(--space-6);
    }
    
    .cta-full__stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }
    
    .cta-stat {
        padding: var(--space-4);
    }
    
    .cta-stat__value {
        font-size: var(--text-2xl);
    }

    .cta-full__buttons {
        flex-direction: column;
    }

    .cta-full__buttons .btn {
        width: 100%;
    }
    
    /* Support Grid */
    .support-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }
    
    .support-card {
        padding: var(--space-5);
    }

    /* Footer */
    .footer__main {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .footer__brand {
        grid-column: span 1;
    }

    .footer__bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    .footer__legal {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ========================================
 * MOBILE LANDSCAPE (< 576px)
 * ======================================== */

@media (max-width: 575px) {
    /* Header */
    .header__logo span {
        display: none;
    }
    
    /* Language Switcher - Mobile - Match Trade Now button size */
    .lang-switcher__toggle {
        padding: var(--space-3) var(--space-4);
        min-height: 44px;
        border-radius: var(--radius-full);
        background: var(--color-bg-tertiary);
        border: 1px solid var(--color-border);
        font-size: var(--text-sm);
    }
    
    .lang-switcher__flag {
        display: none;
    }
    
    .lang-switcher__code {
        display: inline;
        font-size: var(--text-sm);
        font-weight: 500;
    }
    
    .lang-switcher__arrow {
        width: 14px;
        height: 14px;
    }

    /* Hero */
    .hero__badge {
        font-size: var(--text-xs);
    }

    .hero__title {
        font-size: var(--text-3xl);
    }

    .hero__subtitle {
        font-size: var(--text-base);
    }
    
    .hero__preview {
        padding: 0;
    }
    
    /* Feature Items */
    .feature-item {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .feature-item__number {
        font-size: var(--text-2xl);
    }

    /* Conditions */
    .conditions__grid {
        grid-template-columns: 1fr 1fr;
    }

    .conditions__card-value {
        font-size: var(--text-xl);
    }

    /* Account Card */
    .account-card {
        padding: var(--space-4);
    }

    .account-card__type {
        font-size: var(--text-xl);
    }

    .account-card__leverage-value {
        font-size: var(--text-2xl);
    }

    /* Testimonials */
    .testimonial-card {
        padding: var(--space-5);
    }
    
    /* Support Grid */
    .support-grid {
        grid-template-columns: 1fr;
    }
    
    /* Legal Meta */
    .legal-meta {
        flex-direction: column;
        gap: var(--space-3);
    }
}

/* ========================================
 * MOBILE PORTRAIT (< 400px)
 * ======================================== */

@media (max-width: 399px) {
    :root {
        --container-padding: var(--space-3);
    }

    .hero__title {
        font-size: var(--text-2xl);
    }

    .btn {
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-xs);
    }

    .btn-lg {
        padding: var(--space-3) var(--space-5);
    }

    .conditions__grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
 * PREFERS REDUCED MOTION
 * ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .bg-effects {
        display: none;
    }
    
    .ticker {
        animation: none;
    }
}

/* ========================================
 * PRINT STYLES
 * ======================================== */

@media print {
    .header,
    .bg-effects,
    .hero__preview,
    .footer__social,
    .cta,
    .ticker-section {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .section {
        padding: 20px 0;
    }
}
