/* =================================================
   GOALAI WEBSITE - RESPONSIVE STYLES
   Mobile-first responsive design
   ================================================= */

/* =================================================
   1. MOBILE FIRST (Base - 320px and up)
   ================================================= */
/* Already handled in style.css with mobile-first approach */

/* =================================================
   2. SMALL MOBILE (375px and up)
   ================================================= */
@media (min-width: 375px) {
    .hero-title {
        font-size: clamp(3.5rem, 8vw, 7rem);
    }

    .hero-cta {
        flex-direction: row;
    }
}

/* =================================================
   3. LARGE MOBILE / SMALL TABLET (480px and up)
   ================================================= */
@media (min-width: 480px) and (max-width: 767px) {
    :root {
        --spacing-xs: 0.75rem;
        --spacing-sm: 1.25rem;
        --spacing-md: 2.5rem;
        --spacing-lg: 5rem;
        --spacing-xl: 7rem;
    }

    /* Hero section - adjust for larger mobile */
    .hero-section {
        padding-top: 100px;
        justify-content: flex-start;
        padding-bottom: 100px;
    }

    .hero-content {
        margin-top: 3rem;
    }

    .hero-note {
        margin-bottom: 1.5rem;
    }

    /* Position scroll indicator better on medium mobile */
    .scroll-indicator {
        bottom: 30px;
    }

    .container {
        padding: 0 var(--spacing-md);
    }

    .nav-menu {
        gap: var(--spacing-sm);
    }

    .hero-cta .btn {
        padding: 1.125rem 2.25rem;
        font-size: 1.125rem;
    }

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

    .form-group {
        flex-wrap: nowrap;
    }

    .form-input {
        min-width: 200px;
    }
}

/* =================================================
   4. TABLET (768px and up)
   ================================================= */
@media (min-width: 768px) {
    :root {
        --font-size-base: 18px;
    }

    /* Navigation - clamp handles this smoothly */

    /* Hero Section */
    .hero-section {
        min-height: 100vh;
    }

    .hero-title {
        margin-bottom: var(--spacing-md);
    }

    .hero-description {
        font-size: clamp(1.125rem, 2vw, 1.375rem);
    }

    .hero-cta {
        gap: var(--spacing-md);
    }

    /* Sections */
    .section {
        padding: var(--spacing-xl) 0;
    }

    .section-header {
        margin-bottom: var(--spacing-xl);
    }

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

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

    /* Layers */
    .layer-card {
        padding: var(--spacing-xl) var(--spacing-lg);
    }

    /* Tokenomics */
    .tokenomics-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xl);
    }

    .token-diagram {
        max-width: 350px;
    }

    /* NFT Cards */
    .nft-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    /* Waitlist */
    .waitlist-content {
        max-width: 700px;
    }

    .form-group {
        gap: var(--spacing-md);
    }

    .form-input {
        padding: 1.125rem 1.75rem;
        font-size: 1.125rem;
    }

    .form-submit {
        padding: 1.125rem 2.5rem;
    }

    /* Footer */
    .footer {
        padding: var(--spacing-xl) 0 var(--spacing-md);
    }

    .footer-links {
        gap: var(--spacing-lg);
    }
}

/* =================================================
   5. LARGE TABLET (1024px and up)
   ================================================= */
@media (min-width: 1024px) {
    /* Navigation - Show menu, hide hamburger */
    .hamburger {
        display: none;
    }

    .nav-menu {
        display: flex;
    }

    /* Hero */
    .hero-section {
        padding-top: 100px;
    }

    .hero-text {
        max-width: 1000px;
    }

    .hero-divider {
        max-width: 700px;
    }

    /* About */
    .intro-text {
        max-width: 1000px;
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }

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

    /* How It Works */
    .layers-container {
        max-width: 900px;
    }

    /* Tokenomics */
    .tokenomics-content {
        grid-template-columns: 1fr 1.2fr;
    }

    .token-diagram {
        max-width: 400px;
    }

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

    /* Waitlist */
    .waitlist-content {
        max-width: 800px;
    }
}

/* =================================================
   6. LARGE TABLET / SMALL DESKTOP (1200px and up)
   ================================================= */
@media (min-width: 1200px) {
    /* Navigation returns to normal */
    .hamburger {
        display: none;
    }

    .nav-menu {
        position: static;
        width: auto;
        height: auto;
        background: none;
        backdrop-filter: none;
        flex-direction: row;
        padding: 0;
        border: none;
        box-shadow: none;
    }
}

/* =================================================
   7. DESKTOP (1280px and up)
   ================================================= */
@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
        padding: 0 var(--spacing-lg);
    }

    /* Hero */
    .hero-title {
        font-size: clamp(4rem, 8vw, 7rem);
    }

    .hero-subtitle {
        font-size: clamp(2rem, 3vw, 3rem);
    }

    /* Cards */
    .glass-card {
        padding: var(--spacing-lg);
    }

    /* Layers */
    .layer-card {
        padding: var(--spacing-xl);
    }

    /* NFT Cards */
    .nft-card {
        padding: var(--spacing-lg);
    }
}

/* =================================================
   7. LARGE DESKTOP (1536px and up)
   ================================================= */
@media (min-width: 1536px) {
    .container {
        max-width: 1400px;
    }

    :root {
        --spacing-lg: 6rem;
        --spacing-xl: 8rem;
    }
}

/* =================================================
   8. EXTRA LARGE DESKTOP (1920px and up)
   ================================================= */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }

    .hero-title {
        font-size: 7rem;
    }

    .hero-subtitle {
        font-size: 3rem;
    }
}

/* =================================================
   8.5. TABLET / MEDIUM SCREENS (768px to 1199px)
   ================================================= */
@media (min-width: 768px) and (max-width: 1199px) {
    .logo-img {
        width: 58px;
        height: 58px;
    }

    .logo-text {
        font-size: 1.6rem;
    }
}

/* Small tablets and large phones */
@media (min-width: 480px) and (max-width: 767px) {
    .logo-img {
        width: 52px;
        height: 52px;
    }

    .logo-text {
        font-size: 1.3rem;
    }

    .nav-container {
        padding: 0.6rem 1rem;
        min-height: 72px;
    }
}

/* =================================================
   9. MOBILE MENU (Below 1200px)
   ================================================= */
@media (max-width: 1199px) {
    .hamburger {
        display: flex;
        z-index: 1001;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(320px, 80vw);
        height: 100vh;
        background: rgba(11, 11, 15, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        padding: 100px var(--spacing-md) var(--spacing-md);
        gap: var(--spacing-md);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 1px solid rgba(255, 215, 0, 0.2);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

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

    .nav-link {
        width: 100%;
        padding: var(--spacing-sm);
        text-align: center;
        border-bottom: 1px solid rgba(255, 215, 0, 0.1);
        font-size: 1rem;
    }

    .nav-link::after {
        display: none;
    }

    .nav-link.cta-link {
        margin-top: var(--spacing-md);
        border: 2px solid var(--color-gold-primary);
        border-radius: var(--radius-md);
        font-size: 1rem;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    /* Hamburger animation */
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translateY(8px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translateY(-8px);
    }

    /* Overlay when menu is open */
    body.menu-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 998;
        animation: fadeIn 0.3s ease;
    }

    body.menu-open {
        overflow: hidden;
    }
}

/* =================================================
   10. SMALL MOBILE ADJUSTMENTS (Below 480px)
   ================================================= */
@media (max-width: 479px) {
    /* Navbar - Maintain logo prominence on small screens */
    .nav-container {
        padding: 0.5rem 0.875rem;
        min-height: 70px;
    }

    .logo-img {
        width: 48px;
        height: 48px;
    }

    .logo-text {
        font-size: 1.15rem;
    }

    /* Hero section - push content down on mobile */
    .hero-section {
        padding-top: 100px;
        justify-content: flex-start;
        padding-bottom: 100px;
        min-height: 100vh;
    }

    .hero-content {
        margin-top: 2rem;
    }

    .hero-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .hero-note {
        margin-bottom: 1rem;
    }

    /* Position scroll indicator better on small mobile */
    .scroll-indicator {
        bottom: 20px;
        opacity: 0.8;
    }

    .mouse {
        width: 22px;
        height: 35px;
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
    }

    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }

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

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

    .tokenomics-content {
        grid-template-columns: 1fr;
    }

    .token-diagram {
        max-width: 280px;
    }

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

    .form-group {
        flex-direction: column;
    }

    .form-input,
    .form-submit {
        width: 100%;
    }

    .social-links {
        gap: var(--spacing-sm);
    }

    .social-link {
        width: 45px;
        height: 45px;
    }

    .social-link svg {
        width: 20px;
        height: 20px;
    }

    /* Reduce padding on small screens */
    .section {
        padding: var(--spacing-lg) 0;
    }

    .glass-card {
        padding: var(--spacing-sm);
    }

    .layer-card {
        padding: var(--spacing-md);
    }

    .nft-card {
        padding: var(--spacing-sm);
    }

    /* Footer */
    .footer-links {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
}

/* =================================================
   11. LANDSCAPE MOBILE (Below 768px height)
   ================================================= */
@media (max-height: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: var(--spacing-xl) 0;
    }

    .scroll-indicator {
        display: none;
    }

    .nav-menu {
        padding: 80px var(--spacing-md) var(--spacing-md);
        overflow-y: auto;
    }
}

/* =================================================
   12. PRINT STYLES
   ================================================= */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }

    .nav-bar,
    .hero-overlay,
    #sparkles-canvas,
    .floating-particles,
    .scroll-indicator,
    .hamburger,
    .btn,
    .social-links,
    .footer {
        display: none !important;
    }

    .hero-section,
    .section {
        page-break-inside: avoid;
        padding: 2rem 0;
    }

    a {
        text-decoration: underline;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
}

/* =================================================
   13. HIGH DPI SCREENS (Retina)
   ================================================= */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    /* Ensure images are optimized for retina */
    .logo-img,
    .nft-preview,
    .nft-card-image img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* =================================================
   14. TOUCH DEVICES
   ================================================= */
@media (hover: none) and (pointer: coarse) {
    /* Keep animations but remove hover effects on touch devices */
    .glass-card:hover,
    .offering-item:hover,
    .token-feature-card:hover,
    .nft-card:hover {
        transform: none;
    }

    /* Make sure scroll animations still work */
    .reveal {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    }

    .reveal.active {
        opacity: 1;
        transform: translateY(0);
    }

    /* Make touch targets larger */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-link {
        min-height: 44px;
    }

    .social-link {
        min-width: 48px;
        min-height: 48px;
    }

    /* Keep some visual feedback for NFT glow */
    .nft-glow {
        opacity: 0.5;
    }

    /* Ensure particle animations work on touch devices */
    #sparkles-canvas {
        pointer-events: none;
        opacity: 0.7;
    }

    .floating-particles {
        pointer-events: none;
    }

    /* Active touch feedback */
    .btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }

    .nav-link:active {
        color: var(--color-gold-primary);
    }
}

/* =================================================
   15. REDUCED MOTION
   ================================================= */
@media (prefers-reduced-motion: reduce) {
    .glass-card,
    .offering-item,
    .token-feature-card,
    .nft-card,
    .btn {
        transition: none;
    }

    .glass-card:hover,
    .offering-item:hover,
    .token-feature-card:hover,
    .nft-card:hover,
    .btn:hover {
        transform: none;
    }
}

/* =================================================
   16. DARK MODE PREFERENCE
   ================================================= */
@media (prefers-color-scheme: light) {
    /* GoalAI is designed for dark theme, but we can add subtle adjustments */
    :root {
        /* Slightly brighter shadows for better contrast in dark mode */
        --shadow-glow: 0 0 30px rgba(var(--rgb-gold-primary), 0.3);
        --shadow-ai-pulse: 0 0 35px rgba(var(--rgb-gold-primary), 0.5);
    }
}

/* =================================================
   17. ACCESSIBILITY - HIGH CONTRAST MODE
   ================================================= */
@media (prefers-contrast: high) {
    :root {
        --color-gold-primary: #FFE135;
        --color-green-primary: #00FF9D;
    }

    .glass-card,
    .layer-card,
    .nft-card,
    .token-feature-card {
        border-width: 2px;
    }

    .nav-link,
    .footer-link {
        text-decoration: underline;
    }
}

/* =================================================
   18. SAFE AREA INSETS (For notched devices)
   ================================================= */
@supports (padding: max(0px)) {
    .nav-bar {
        padding-left: max(var(--spacing-md), env(safe-area-inset-left));
        padding-right: max(var(--spacing-md), env(safe-area-inset-right));
    }

    .container {
        padding-left: max(var(--spacing-md), env(safe-area-inset-left));
        padding-right: max(var(--spacing-md), env(safe-area-inset-right));
    }
}

/* =================================================
   19. ROADMAP RESPONSIVE
   ================================================= */
@media (max-width: 767px) {
    .roadmap-phase {
        grid-template-columns: 40px 1fr;
        gap: var(--spacing-sm);
    }

    .phase-dot {
        width: 18px;
        height: 18px;
        border-width: 2px;
    }

    .phase-content {
        padding: var(--spacing-sm);
    }

    .phase-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .phase-icon {
        font-size: 1.5rem;
    }

    .phase-title {
        font-size: 1rem;
        min-width: auto;
    }

    .phase-date {
        align-self: flex-start;
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }

    .phase-details li {
        font-size: 0.875rem;
        padding-left: 1.25rem;
    }

    .roadmap-flow {
        padding: var(--spacing-md);
    }

    .flow-title {
        font-size: 1.25rem;
    }

    .flow-path {
        flex-direction: column;
        gap: 0.75rem;
    }

    .flow-step {
        padding: 0.6rem 1rem;
        font-size: 0.875rem;
        text-align: center;
    }

    .flow-arrow {
        font-size: 1.25rem;
        transform: rotate(90deg);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .phase-title {
        font-size: 1.1rem;
    }

    .flow-step {
        font-size: 0.9rem;
        padding: 0.65rem 1.1rem;
    }
}

/* =================================================
   20. MODAL RESPONSIVE
   ================================================= */
@media (max-width: 767px) {
    .modal {
        padding: var(--spacing-sm);
    }

    .modal-container {
        max-height: 90vh;
    }

    .modal-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-close {
        width: 36px;
        height: 36px;
    }

    .modal-close svg {
        width: 18px;
        height: 18px;
    }

    .modal-content {
        padding: var(--spacing-md);
    }

    .modal-section {
        margin-bottom: var(--spacing-md);
    }

    .modal-section h3 {
        font-size: 1.1rem;
    }

    .modal-section p,
    .modal-section li {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .modal-contact {
        padding: var(--spacing-sm);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .modal-container {
        max-width: 90%;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-section h3 {
        font-size: 1.15rem;
    }
}

/* Touch devices - make modal close easier */
@media (hover: none) and (pointer: coarse) {
    .modal-close {
        min-width: 44px;
        min-height: 44px;
    }

    .modal-overlay {
        cursor: default;
    }
}

/* Landscape mobile - adjust modal height */
@media (max-height: 600px) and (orientation: landscape) {
    .modal-container {
        max-height: 95vh;
    }

    .modal-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .modal-content {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .modal-section {
        margin-bottom: var(--spacing-sm);
    }
}

/* Reduced motion for modals */
@media (prefers-reduced-motion: reduce) {
    .modal-overlay,
    .modal-container {
        animation: none !important;
    }

    .modal.active {
        opacity: 1;
    }
}
