/**
 * EcoGround Premium Responsive Styles
 * Version 2.0 - Mobile-first approach
 */

/* ============================================
   MOBILE BASE (Default < 640px)
   ============================================ */

/* Mobile optimizations */
.is-mobile body {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-overflow-scrolling: touch;
}

.is-mobile .cosmic-background,
.is-mobile #cosmic-bg {
    display: none;
}

/* Hero Mobile */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--space-4xl) 0 var(--space-2xl);
}

.hero-content {
    padding: var(--space-lg);
}

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

.hero-description {
    font-size: var(--text-body);
}

.hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
}

.hero-stat-value {
    font-size: var(--text-h2);
}

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

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

.scroll-indicator {
    display: none;
}

/* Section Mobile */
.section {
    padding: var(--space-3xl) 0;
}

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

.section-title {
    font-size: var(--text-h2);
}

.section-label::before,
.section-label::after {
    width: 20px;
}

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

.bento-span-2,
.bento-span-3 {
    grid-column: span 1;
}

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

.stat-card {
    padding: var(--space-lg);
}

.stat-value {
    font-size: var(--text-h2);
}

/* Card Mobile */
.card,
.glass-card,
.premium-card {
    padding: var(--space-xl);
}

/* Footer Mobile */
.footer-top {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
}

.footer-links {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
}

.footer-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    padding: var(--space-2xl) 0;
}

.footer-bottom {
    flex-direction: column;
    text-align: center;
}

/* Navigation Mobile */
.main-nav.desktop-nav {
    display: none;
}

.mobile-menu-toggle {
    display: flex;
}

/* Slider Mobile */
.slider-slide {
    min-height: 400px;
    padding: var(--space-xl);
}

.slider-nav {
    width: 44px;
    height: 44px;
}

.slider-prev {
    left: var(--space-sm);
}

.slider-next {
    right: var(--space-sm);
}

/* Form Mobile */
.form-group {
    margin-bottom: var(--space-lg);
}

/* Scroll to top mobile position */
.scroll-to-top {
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 48px;
    height: 48px;
}

/* ============================================
   SMALL TABLETS (>= 640px)
   ============================================ */
@media (min-width: 640px) {
    .hero-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .hero-actions {
        flex-direction: row;
        width: auto;
    }

    .hero-actions .btn {
        width: auto;
    }

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

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

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

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

/* ============================================
   TABLETS (>= 768px)
   ============================================ */
@media (min-width: 768px) {
    .section {
        padding: var(--space-4xl) 0;
    }

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

    .hero-title {
        font-size: clamp(3rem, 8vw, 5rem);
    }

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

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

    .bento-span-2 {
        grid-column: span 2;
    }

    .card,
    .glass-card,
    .premium-card {
        padding: var(--space-2xl);
    }

    .footer-top {
        grid-template-columns: 1.5fr 1fr;
    }

    .slider-slide {
        min-height: 450px;
        padding: var(--space-2xl);
    }

    .scroll-indicator {
        display: flex;
    }
}

/* ============================================
   DESKTOP (>= 1024px)
   ============================================ */
@media (min-width: 1024px) {
    .section {
        padding: var(--space-5xl) 0;
    }

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

    .hero {
        padding-top: 120px;
    }

    .hero-title {
        font-size: var(--text-hero);
    }

    .hero-description {
        font-size: var(--text-h4);
    }

    /* Navigation Desktop */
    .main-nav.desktop-nav {
        display: block;
    }

    .mobile-menu-toggle {
        display: none;
    }

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

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

    .bento-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-top {
        grid-template-columns: 2fr 1fr;
    }

    .slider-slide {
        min-height: 500px;
        padding: var(--space-3xl);
    }

    .slider-nav {
        width: 56px;
        height: 56px;
    }

    .slider-prev {
        left: var(--space-lg);
    }

    .slider-next {
        right: var(--space-lg);
    }
}

/* ============================================
   LARGE DESKTOP (>= 1400px)
   ============================================ */
@media (min-width: 1400px) {
    :root {
        --container-padding: 4rem;
    }

    .section-lg {
        padding: var(--space-6xl) 0;
    }

    .hero-content {
        max-width: 1100px;
    }

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

    .bento-span-2 {
        grid-column: span 2;
    }

    .bento-span-3 {
        grid-column: span 3;
    }
}

/* ============================================
   EXTRA LARGE DESKTOP (>= 1920px)
   ============================================ */
@media (min-width: 1920px) {
    :root {
        font-size: 18px;
    }
}

/* ============================================
   HEIGHT BASED QUERIES
   ============================================ */
@media (max-height: 700px) {
    .hero {
        min-height: auto;
        padding: var(--space-4xl) 0 var(--space-2xl);
    }

    .hero-stats {
        margin-top: var(--space-xl);
        padding-top: var(--space-lg);
    }

    .scroll-indicator {
        display: none;
    }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */
@media (prefers-contrast: high) {
    :root {
        --glass-bg: rgba(0, 0, 0, 0.8);
        --glass-border: rgba(255, 255, 255, 0.5);
    }

    .glass-card,
    .card,
    .premium-card {
        border-width: 2px;
    }

    .btn-primary {
        background: var(--accent-emerald);
    }

    .btn-secondary {
        border-width: 2px;
    }
}

/* ============================================
   DARK MODE (System preference)
   Already dark by default, but explicit support
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark mode */
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .site-header,
    .site-footer,
    .mobile-nav,
    .mobile-overlay,
    .scroll-to-top,
    .cosmic-background,
    #cosmic-bg {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .section {
        padding: 2rem 0;
    }

    .card,
    .glass-card,
    .premium-card {
        border: 1px solid #ccc;
        background: white;
        break-inside: avoid;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    .btn {
        border: 1px solid black;
        background: white;
        color: black;
    }
}

/* ============================================
   LANDSCAPE MOBILE
   ============================================ */
@media (max-width: 900px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-2xl) 0;
    }

    .hero-stats {
        margin-top: var(--space-lg);
    }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch devices */
    .card:hover,
    .glass-card:hover,
    .premium-card:hover,
    .btn:hover {
        transform: none;
    }

    /* Larger touch targets */
    .btn {
        min-height: 48px;
    }

    .nav-link,
    .mobile-nav-link {
        min-height: 48px;
    }

    /* Active states instead of hover */
    .card:active,
    .glass-card:active,
    .premium-card:active {
        transform: scale(0.98);
    }

    .btn:active {
        transform: scale(0.95);
    }
}

/* ============================================
   SAFE AREA (Notch devices)
   ============================================ */
@supports (padding: max(0px)) {
    .site-header {
        padding-left: max(var(--container-padding), env(safe-area-inset-left));
        padding-right: max(var(--container-padding), env(safe-area-inset-right));
    }

    .mobile-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .site-footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
