/* ============================================
   SubFine Website - Responsive Design
   Mobile-first breakpoints and adaptations
   ============================================ */

/* ============================================
   Breakpoints
   ============================================ */
/* 
   Mobile: < 768px (default)
   Tablet: 768px - 1023px
   Desktop: 1024px - 1439px
   Large: >= 1440px
*/

/* ============================================
   Tablet (768px and up)
   ============================================ */
@media (max-width: 1023px) {

    /* Navigation */
    .nav-links {
        gap: var(--spacing-md);
    }

    /* Hero */
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .hero-visual {
        order: -1;
        max-width: 500px;
        margin: 0 auto;
    }

    .hero-text {
        text-align: center;
        max-width: none;
    }

    .hero-cta {
        justify-content: center;
    }

    /* Features */
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--spacing-md);
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   Mobile (max-width: 767px)
   ============================================ */
@media (max-width: 767px) {

    /* Typography scaling */
    html {
        font-size: 14px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    p {
        font-size: 1rem;
    }

    /* Spacing adjustments */
    section {
        padding: var(--spacing-xl) 0;
    }

    .container,
    .container-wide {
        padding: 0 var(--spacing-sm);
    }

    /* Navigation */
    nav {
        position: fixed;
    }

    .nav-container {
        padding: var(--spacing-sm);
    }

    .nav-logo {
        font-size: 1.25rem;
    }

    .nav-logo img {
        width: 32px;
        height: 32px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border-dark);
        flex-direction: column;
        padding: var(--spacing-sm) 0;
        gap: 0;
        box-shadow: var(--shadow-md);
    }

    .nav-links.mobile-open {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: var(--spacing-sm) var(--spacing-md);
        border-bottom: 1px solid var(--border-dark);
    }

    .nav-links a:hover {
        background: var(--bg-dark-tertiary);
    }

    .nav-actions {
        gap: var(--spacing-xs);
    }

    .lang-toggle {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .mobile-menu-btn {
        display: block;
    }

    /* Hero */
    .hero {
        min-height: auto;
        padding-top: 100px;
        padding-bottom: var(--spacing-xl);
    }

    .hero-content {
        gap: var(--spacing-md);
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .hero-cta {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-visual {
        max-width: 100%;
    }

    /* Buttons */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    /* Section headers */
    .section-header {
        margin-bottom: var(--spacing-lg);
    }

    .section-subtitle {
        font-size: 0.75rem;
    }

    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .feature-card {
        padding: var(--spacing-md);
    }

    .feature-icon {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }

    /* Platform logos */
    .platform-logos {
        gap: var(--spacing-md);
    }

    .platform-logo img {
        max-width: 80px;
    }

    /* Carousel */
    .carousel {
        margin: var(--spacing-lg) auto;
    }

    .carousel-controls {
        padding: 0;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .carousel-dot {
        width: 10px;
        height: 10px;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        text-align: center;
    }

    .footer-links {
        align-items: center;
    }

    .footer-bottom {
        font-size: 0.75rem;
    }

    /* Forms */
    input,
    textarea,
    select {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    /* Cards and containers */
    .card {
        padding: var(--spacing-md);
    }

    /* Modals and overlays */
    .modal {
        margin: var(--spacing-sm);
        max-width: calc(100% - 2rem);
    }
}

/* ============================================
   Small Mobile (max-width: 374px)
   ============================================ */
@media (max-width: 374px) {
    html {
        font-size: 13px;
    }

    .nav-logo {
        font-size: 1.1rem;
    }

    .nav-logo img {
        width: 28px;
        height: 28px;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }

    .feature-card {
        padding: var(--spacing-sm);
    }
}

/* ============================================
   Large Desktop (min-width: 1440px)
   ============================================ */
@media (min-width: 1440px) {
    .container {
        max-width: 1300px;
    }

    .container-wide {
        max-width: 1600px;
    }

    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   Touch Device Optimizations
   ============================================ */
@media (hover: none) and (pointer: coarse) {

    /* Increase touch targets */
    .btn,
    button,
    a {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    .hover-lift:hover,
    .hover-glow:hover,
    .hover-scale:hover {
        transform: none;
        box-shadow: none;
        filter: none;
    }

    /* Clickable feedback instead */
    .btn:active {
        transform: scale(0.98);
    }
}

/* ============================================
   RTL Support
   ============================================ */
[dir="rtl"] {

    /* Navigation */
    .nav-container {
        direction: rtl;
    }

    /* Hero */
    .hero-content {
        direction: rtl;
    }

    /* Features */
    .feature-card {
        text-align: right;
    }

    /* Carousel */
    .carousel-track {
        direction: rtl;
    }

    /* Footer */
    .footer-section {
        text-align: right;
    }

    /* Animations for RTL */
    @keyframes slideInLeft {
        from {
            opacity: 0;
            transform: translateX(50px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    @keyframes slideInRight {
        from {
            opacity: 0;
            transform: translateX(-50px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {

    nav,
    .hero-cta,
    .carousel-controls,
    footer {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    a {
        text-decoration: underline;
    }

    .hero,
    section {
        page-break-inside: avoid;
    }
}

/* ============================================
   Landscape Mobile Optimizations
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--spacing-lg) 0;
    }

    section {
        padding: var(--spacing-lg) 0;
    }
}

/* ============================================
   High Contrast Mode Support
   ============================================ */
@media (prefers-contrast: high) {
    :root {
        --text-gray: #e0e0e0;
        --border-dark: #444444;
    }

    .btn-primary {
        border: 2px solid #000;
    }

    .feature-card {
        border-width: 2px;
    }
}