/* =====================================================
   RESPONSIVE STYLES - PAIGHAM-E-PAKISTAN
   ===================================================== */

/* Large Desktops (1400px+) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Desktop to Tablet (max-width: 1199px) */
@media (max-width: 1199px) {
    :root {
        --text-6xl: 3rem;
        --text-5xl: 2.5rem;
        --text-4xl: 2rem;
    }

    .hero-grid {
        gap: var(--space-10);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
}

/* Tablet (max-width: 991px) */
@media (max-width: 991px) {
    :root {
        --text-6xl: 2.5rem;
        --text-5xl: 2.25rem;
        --text-4xl: 1.875rem;
        --text-3xl: 1.5rem;
        --header-height: 120px;
    }

    /* Mobile Navigation */
    .nav-toggle {
        display: flex;
    }

    /* Reduce logo for smaller screens */
    .site-logo {
        height: 56px;
        max-height: 56px;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 320px;
        height: 100vh;
        background: var(--color-white);
        flex-direction: column;
        align-items: stretch;
        padding: 100px var(--space-6) var(--space-8);
        transition: right var(--transition-normal);
        box-shadow: var(--shadow-2xl);
        overflow-y: auto;
        z-index: var(--z-fixed);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-item {
        border-bottom: 1px solid var(--color-gray-100);
    }

    .nav-link {
        padding: var(--space-4) var(--space-4);
        font-size: var(--text-base);
        justify-content: space-between;
    }

    /* Mobile Dropdown */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-normal);
        background: var(--color-gray-50);
    }

    .nav-item.dropdown-open .dropdown-menu {
        max-height: 600px;
        padding: var(--space-2) 0;
    }

    .dropdown-item {
        padding: var(--space-3) var(--space-8);
    }

    /* Mobile Overlay */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: calc(var(--z-fixed) - 1);
    }

    .nav-overlay.active {
        display: block;
    }

    /* Hero */
    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + var(--space-12)) 0 var(--space-20);
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: var(--space-10);
        text-align: center;
    }

    .hero-description {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-visual {
        order: -1;
    }

    .hero-card {
        max-width: 360px;
        margin: 0 auto;
    }

    .hero-visual-img {
        max-width: 100%;
        margin: 0 auto;
    }

    .hero-visual-img img {
        min-height: 300px;
    }

    /* Image components responsive */
    .feature-visual-img {
        min-height: 280px;
    }

    .feature-visual-img img {
        min-height: 280px;
    }

    /* Page Hero */
    .page-hero {
        padding: calc(var(--space-20) + 40px) 0 var(--space-12);
    }

    .page-hero h1 {
        font-size: var(--text-4xl);
    }

    /* Features */
    .feature-block {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }

    .feature-block.reverse {
        direction: ltr;
    }

    /* Grid */
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* Timeline */
    .timeline::before {
        left: 20px;
    }

    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        flex-direction: row;
        padding-left: 50px;
    }

    .timeline-content {
        width: 100%;
    }

    .timeline-dot {
        left: 20px;
    }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
    :root {
        --text-6xl: 2rem;
        --text-5xl: 1.875rem;
        --text-4xl: 1.5rem;
        --text-3xl: 1.25rem;
        --space-24: 4rem;
        --space-20: 3.5rem;
        --space-16: 3rem;
    }

    .section {
        padding: var(--space-16) 0;
    }

    .section-header {
        margin-bottom: var(--space-10);
    }

    /* Top Bar */
    .top-bar {
        display: none;
    }

    /* Hero */
    .hero::after {
        height: 40px;
    }

    .hero-features {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        flex-direction: column;
        gap: var(--space-6);
    }

    .hero-stat {
        text-align: center;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
    }

    /* Grid */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        text-align: center;
    }

    .footer-column h4::after {
        margin: var(--space-3) auto 0;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    .footer-bottom-links {
        justify-content: center;
    }

    /* CTA */
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-buttons .btn {
        width: 100%;
        max-width: 280px;
    }

    /* Image responsive */
    .hero-visual-img img {
        min-height: 260px;
    }

    .feature-visual-img {
        min-height: 240px;
    }

    .feature-visual-img img {
        min-height: 240px;
    }

    .section-banner {
        max-height: 220px;
    }

    .quote-author-avatar-img {
        width: 56px;
        height: 56px;
    }

    /* Cards */
    .focus-card {
        padding: var(--space-8);
    }

    .quote-card {
        padding: var(--space-6);
    }

    .quote-text {
        font-size: var(--text-lg);
    }

    /* Form */
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-card {
        padding: var(--space-6);
    }

    /* Partner Cards */
    .partner-card {
        flex-direction: column;
        text-align: center;
    }

    /* Tabs */
    .tabs {
        flex-wrap: nowrap;
        gap: 0;
    }

    .tab-btn {
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-xs);
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    :root {
        --text-6xl: 1.75rem;
        --text-5xl: 1.625rem;
    }

    .container {
        padding: 0 var(--space-4);
    }

    .nav-menu {
        width: 100%;
    }

    .hero-card {
        padding: var(--space-6);
    }

    .hero-card-icon {
        width: 72px;
        height: 72px;
        font-size: var(--text-3xl);
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-number {
        font-size: var(--text-3xl);
    }

    .focus-card-icon {
        width: 64px;
        height: 64px;
        font-size: var(--text-xl);
    }

    .btn {
        padding: 0.625rem 1.5rem;
        font-size: var(--text-sm);
    }

    .btn-lg {
        padding: 0.75rem 1.75rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .top-bar,
    .hero-buttons,
    .cta-section,
    .back-to-top,
    .nav-toggle,
    .footer-social {
        display: none !important;
    }

    .hero {
        min-height: auto;
        padding: var(--space-8) 0;
    }

    .hero::after,
    .hero::before {
        display: none;
    }

    .section {
        padding: var(--space-8) 0;
    }

    body {
        color: #000;
        background: #fff;
    }

    .card,
    .focus-card,
    .quote-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #005a00;
        --color-accent: #b8860b;
    }

    .card,
    .focus-card,
    .quote-card {
        border-width: 2px;
    }
}
