/* ===== RESPONSIVE DESIGN ===== */

/* ===== LARGE SCREENS (1400px+) ===== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3.2rem;
    }
}

/* ===== LARGE TABLETS & SMALL DESKTOPS (992px - 1199px) ===== */
@media (max-width: 1199px) {
    .hero-content {
        gap: 3rem;
    }
    
    .hero-title {
        font-size: 3.2rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== TABLETS (768px - 991px) ===== */
@media (max-width: 991px) {
    :root {
        --section-padding: 60px 0;
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: #03A9F4;
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        transition: var(--transition-medium);
        z-index: 9999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .nav-link {
        font-size: 1.2rem;
        padding: 1rem 0;
    }
    
    .nav-toggle {
        display: flex;
        z-index: 10000;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .nav-cta {
        display: none;
    }
    
    /* Hero Section */
    .hero {
        min-height: 90vh;
        padding-top: 80px;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .hero-stats {
        justify-content: center;
        gap: 1.5rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-image-container {
        width: 250px;
        height: 250px;
    }
    
    .hero-icon {
        font-size: 6rem;
    }
    
    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .about-features {
        max-width: 500px;
        margin: 2rem auto 0;
    }
    
    /* Services */
    .tab-buttons {
        gap: 1rem;
    }
    
    .tab-button {
        font-size: 1rem;
        padding: 10px 20px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    /* Process Steps */
    .process-steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== SMALL TABLETS & LARGE PHONES (576px - 767px) ===== */
@media (max-width: 767px) {
    :root {
        --section-padding: 50px 0;
        --container-padding: 0 15px;
    }
    
    /* Typography */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2.2rem; }
    h3 { font-size: 1.6rem; }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .section-subtitle {
        font-size: 1.1rem;
    }
    
    /* Navigation */
    .navbar {
        padding: 0.8rem 0;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .logo {
        height: 40px;
    }
    
    .brand-text {
        font-size: 1.5rem;
    }
    
    /* Hero */
    .hero {
        min-height: 80vh;
        padding-top: 70px;
    }
    
    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .stat-item {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
        margin: 0;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .hero-image-container {
        width: 200px;
        height: 200px;
    }
    
    .hero-icon {
        font-size: 4.5rem;
    }
    
    /* About */
    .about-text h3 {
        font-size: 1.6rem;
        text-align: center;
    }
    
    .feature-item {
        text-align: left;
    }
    
    /* Services */
    .tab-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .tab-button {
        width: 100%;
        max-width: 250px;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
    }
    
    .service-icon i {
        font-size: 1.5rem;
    }
    
    /* Achievements */
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .achievement-card {
        padding: 1.5rem;
    }
    
    .achievement-icon {
        width: 70px;
        height: 70px;
    }
    
    .achievement-number {
        font-size: 2.5rem;
    }
    
    /* Process Steps */
    .process-steps {
        grid-template-columns: 1fr;
    }
    
    .step {
        padding: 1.5rem 1rem;
    }
    
    /* Contact */
    .contact-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        text-align: left;
    }
    
    .contact-form-container {
        padding: 2rem;
    }
    
    /* Footer */
    .footer {
        padding: 2.5rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-bottom-links {
        justify-content: center;
        gap: 1rem;
    }
    
    /* Back to top */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    /* Form messages */
    .form-messages {
        right: 15px;
        left: 15px;
        top: 80px;
    }
}

/* ===== PHONES (480px - 575px) ===== */
@media (max-width: 575px) {
    :root {
        --section-padding: 40px 0;
    }
    
    /* Typography */
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* Hero */
    .hero-stats {
        gap: 0.8rem;
    }
    
    .stat-item {
        flex-direction: column;
        gap: 0.2rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .hero-image-container {
        width: 180px;
        height: 180px;
    }
    
    .hero-icon {
        font-size: 4rem;
    }
    
    /* Services */
    .service-card {
        padding: 1.2rem;
    }
    
    /* Achievements */
    .achievement-card {
        padding: 1.2rem;
    }
    
    .achievement-icon {
        width: 60px;
        height: 60px;
    }
    
    .achievement-icon i {
        font-size: 1.5rem;
    }
    
    .achievement-number {
        font-size: 2.2rem;
    }
    
    /* Contact */
    .contact-form-container {
        padding: 1.5rem;
    }
}

/* ===== VERY SMALL PHONES (320px - 479px) ===== */
@media (max-width: 479px) {
    :root {
        --container-padding: 0 10px;
    }
    
    /* Navigation */
    .nav-container {
        padding: 0 10px;
    }
    
    .brand-text {
        font-size: 1.3rem;
    }
    
    /* Hero */
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .hero-image-container {
        width: 160px;
        height: 160px;
    }
    
    .hero-icon {
        font-size: 3.5rem;
    }
    
    /* Sections */
    .section-header {
        margin-bottom: 2.5rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    /* About */
    .about-card {
        padding: 2rem 1.5rem;
    }
    
    /* Services */
    .service-card {
        padding: 1rem;
    }
    
    .service-card h3 {
        font-size: 1.2rem;
    }
    
    .service-icon {
        width: 50px;
        height: 50px;
    }
    
    .service-icon i {
        font-size: 1.3rem;
    }
    
    /* Achievements */
    .achievement-card {
        padding: 1rem;
    }
    
    .achievement-number {
        font-size: 2rem;
    }
    
    /* Steps */
    .step {
        padding: 1rem 0.5rem;
    }
    
    .step-number {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    /* Contact */
    .contact-info h3 {
        font-size: 1.4rem;
    }
    
    .contact-form-container {
        padding: 1.2rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    /* Footer */
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-section h4 {
        font-size: 1.1rem;
    }
}

/* ===== LANDSCAPE ORIENTATION ON PHONES ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding-top: 60px;
    }
    
    .hero-content {
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }
    
    .hero-description {
        margin-bottom: 1rem;
    }
    
    .hero-stats {
        flex-direction: row;
        gap: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    .hero-image-container {
        width: 150px;
        height: 150px;
    }
    
    .hero-icon {
        font-size: 3rem;
    }
}

/* ===== HOVER EFFECTS ON TOUCH DEVICES ===== */
@media (hover: none) and (pointer: coarse) {
    .service-card:hover,
    .achievement-card:hover {
        transform: none;
    }
    
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
    
    .nav-link:hover::after {
        width: 0;
    }
}

/* ===== HIGH DPI DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
    .hero-image-container,
    .service-icon,
    .achievement-icon {
        /* Ensure icons remain crisp on high-DPI displays */
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #F8FAFC;
        --text-secondary: #CBD5E0;
        --text-light: #A0AEC0;
        --light-bg: #1A202C;
        --border-color: #2D3748;
        --white: #2D3748;
    }
    
    body {
        background-color: #1A202C;
        color: #F8FAFC;
    }
    
    .header {
        background: rgba(26, 32, 44, 0.95);
    }
    
    .hero {
        background: linear-gradient(135deg, #1A202C 0%, #2D3748 100%);
    }
    
    .about {
        background: #2D3748;
    }
    
    .services {
        background: #1A202C;
    }
    
    .achievements {
        background: #2D3748;
    }
    
    .how-it-works {
        background: #1A202C;
    }
    
    .contact {
        background: #2D3748;
    }
    
    .service-card,
    .contact-form-container {
        background: #2D3748;
        border-color: #4A5568;
    }
    
    .tab-button {
        background: #2D3748;
        border-color: #4A5568;
        color: #CBD5E0;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: #1A202C;
        border-color: #4A5568;
        color: #F8FAFC;
    }
}

/* ===== PRINT OPTIMIZATIONS ===== */
@media print {
    .hero-content {
        grid-template-columns: 1fr;
    }
    
    .services-grid,
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .hero-image,
    .about-image {
        display: none;
    }
    
    .hero-buttons,
    .service-link {
        display: none;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    .hero-image-container {
        animation: none;
    }
}

/* Focus visible for better keyboard navigation */
@supports selector(:focus-visible) {
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: none;
    }
    
    a:focus-visible,
    button:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}