/* ========================================
   NexJin.ai Responsive Styles
   Mobile-First Approach
   ======================================== */

/* ========================================
   Base Mobile Styles (< 640px)
   ======================================== */

/* Already defined in main styles as mobile-first */

/* ========================================
   Small Devices (≥ 640px) - Tablets Portrait
   ======================================== */

@media (min-width: 640px) {
    /* Typography */
    h1 {
        font-size: 3.5rem;
    }
    
    h2 {
        font-size: 2.5rem;
    }
    
    /* Hero Section */
    #hero {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
    
    /* Feature Cards */
    .feature-card {
        padding: 2rem;
    }
    
    /* Buttons */
    .btn-primary,
    .btn-secondary {
        padding: 1.25rem 2.5rem;
        font-size: 1.125rem;
    }
}

/* ========================================
   Medium Devices (≥ 768px) - Tablets Landscape
   ======================================== */

@media (min-width: 768px) {
    /* Navigation */
    nav .max-w-7xl {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    /* Typography */
    h1 {
        font-size: 4rem;
    }
    
    h2 {
        font-size: 2.75rem;
    }
    
    p {
        font-size: 1.125rem;
    }
    
    /* Hero Section */
    #hero {
        min-height: 100vh;
    }
    
    #hero .max-w-7xl {
        padding-top: 8rem;
        padding-bottom: 8rem;
    }
    
    /* Sections */
    section {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
    
    /* Feature Cards Grid */
    .feature-card {
        min-height: 350px;
    }
    
    /* Stats Section */
    .stats-grid {
        gap: 3rem;
    }
    
    /* Footer */
    footer {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}

/* ========================================
   Large Devices (≥ 1024px) - Desktops
   ======================================== */

@media (min-width: 1024px) {
    /* Typography */
    h1 {
        font-size: 5rem;
        line-height: 1.1;
    }
    
    h2 {
        font-size: 3rem;
    }
    
    p {
        font-size: 1.25rem;
        line-height: 1.8;
    }
    
    /* Navigation */
    nav {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    /* Hero Section */
    #hero h1 {
        font-size: 5.5rem;
        letter-spacing: -0.03em;
    }
    
    #hero p {
        font-size: 1.5rem;
    }
    
    /* Feature Cards */
    .feature-card {
        padding: 2.5rem;
    }
    
    .feature-card h3 {
        font-size: 1.75rem;
    }
    
    /* How It Works Section */
    #how-it-works .grid {
        gap: 4rem;
    }
    
    /* CTA Section */
    #cta h2 {
        font-size: 4rem;
    }
    
    #cta p {
        font-size: 1.5rem;
    }
    
    /* Spacing */
    section {
        padding-top: 8rem;
        padding-bottom: 8rem;
    }
}

/* ========================================
   Extra Large Devices (≥ 1280px) - Large Desktops
   ======================================== */

@media (min-width: 1280px) {
    /* Typography */
    h1 {
        font-size: 6rem;
    }
    
    h2 {
        font-size: 3.5rem;
    }
    
    /* Hero Section */
    #hero h1 {
        font-size: 7rem;
    }
    
    #hero p {
        font-size: 1.75rem;
    }
    
    /* Container Max Width */
    .max-w-7xl {
        max-width: 1280px;
    }
    
    /* Feature Cards */
    .feature-card {
        padding: 3rem;
    }
    
    /* Sections */
    section {
        padding-top: 10rem;
        padding-bottom: 10rem;
    }
}

/* ========================================
   2XL Devices (≥ 1536px) - Ultra Wide
   ======================================== */

@media (min-width: 1536px) {
    /* Typography */
    h1 {
        font-size: 7rem;
    }
    
    /* Hero Section */
    #hero h1 {
        font-size: 8rem;
    }
    
    /* Container Max Width */
    .max-w-7xl {
        max-width: 1440px;
    }
}

/* ========================================
   Mobile-Specific Optimizations
   ======================================== */

@media (max-width: 639px) {
    /* Hero Section - Mobile Adjustments */
    #hero {
        min-height: auto;
        padding-top: 6rem;
        padding-bottom: 4rem;
    }
    
    #hero h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    #hero p {
        font-size: 1rem;
    }
    
    /* Mobile Navigation */
    #mobile-menu {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }
    
    /* Feature Cards - Mobile Stack */
    .feature-card {
        margin-bottom: 1.5rem;
    }
    
    /* Buttons - Full Width on Mobile */
    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }
    
    /* Stats Section - Mobile */
    .stats-grid > div {
        padding: 2rem 1rem;
    }
    
    /* Footer - Mobile Stack */
    footer .grid {
        gap: 2rem;
    }
    
    /* Reduce animation intensity on mobile */
    .animate-blob {
        animation-duration: 10s;
    }
}

/* ========================================
   Tablet-Specific Optimizations
   ======================================== */

@media (min-width: 640px) and (max-width: 1023px) {
    /* Hero Section - Tablet */
    #hero h1 {
        font-size: 4rem;
    }
    
    #hero p {
        font-size: 1.25rem;
    }
    
    /* Feature Cards - Two Column on Tablet */
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    /* How It Works - Adjust Spacing */
    #how-it-works .grid {
        gap: 3rem;
    }
}

/* ========================================
   Landscape Mode Optimizations
   ======================================== */

@media (max-height: 600px) and (orientation: landscape) {
    /* Reduce Hero Height in Landscape */
    #hero {
        min-height: auto;
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    
    /* Reduce Section Padding */
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

/* ========================================
   Touch Device Optimizations
   ======================================== */

@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .feature-card:hover {
        transform: none;
    }
    
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
    
    /* Increase touch target sizes */
    a, button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ========================================
   High Resolution Displays
   ======================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for retina displays */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ========================================
   Dark Mode Support (Optional)
   ======================================== */

@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode support */
    /*
    :root {
        --neutral-white: #1e293b;
        --neutral-lightgray: #0f172a;
        --neutral-darktext: #f8fafc;
    }
    
    body {
        background-color: var(--neutral-lightgray);
        color: var(--neutral-darktext);
    }
    
    .feature-card {
        background-color: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    */
}

/* ========================================
   Print Optimizations
   ======================================== */

@media print {
    /* Reset all responsive styles for print */
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    a, a:visited {
        text-decoration: underline;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    h2, h3 {
        page-break-after: avoid;
    }
}

/* ========================================
   Accessibility - Screen Reader Only
   ======================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   Loading States
   ======================================== */

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   Smooth Scroll Offset for Fixed Nav
   ======================================== */

section[id] {
    scroll-margin-top: 5rem;
}

@media (min-width: 768px) {
    section[id] {
        scroll-margin-top: 6rem;
    }
}