/* ========================================
   TURKOTAG - RESPONSIVE DESIGN
   Mobile-First, Tablet, Desktop
   ======================================== */

/* ========================================
   MOBILE FIRST BASE (< 480px)
   ======================================== */

/* Mobile Menu Toggle */
.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: var(--transition-fast);
    border-radius: 1px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 100px var(--space-lg) var(--space-lg);
        flex-direction: column;
        gap: var(--space-sm);
        display: none;
        z-index: 999;
        overflow-y: auto;
    }

    .nav-menu.open {
        display: flex;
        animation: slideDown 0.3s ease;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .nav-menu li {
        border-bottom: 1px solid var(--color-border-subtle);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        padding: var(--space-md);
        text-align: center;
        font-size: 1.1rem;
        display: block;
    }
}

/* ========================================
   SMALL MOBILE (< 380px)
   ======================================== */
@media (max-width: 380px) {
    :root {
        --space-lg: 1.5rem;
        --space-xl: 2rem;
        --space-2xl: 3rem;
        --space-3xl: 4rem;
    }

    .hero-title {
        font-size: 2rem !important;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-buttons {
        width: 100%;
    }

    .stat-number {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .app-card {
        padding: var(--space-md);
    }

    .app-icon {
        width: 64px;
        height: 64px;
    }
}

/* ========================================
   MOBILE (480px - 767px)
   ======================================== */
@media (min-width: 480px) and (max-width: 767px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .apps-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   TABLET (768px - 1023px)
   ======================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    .menu-toggle {
        display: none;
    }

    .nav-menu {
        display: flex !important;
        position: static;
        background: none;
        backdrop-filter: none;
        padding: 0;
        flex-direction: row;
    }

    .nav-menu li {
        border-bottom: none;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-inner {
        padding: var(--space-sm) var(--space-lg);
    }

    .nav-menu a {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.85rem;
    }
}

/* ========================================
   SMALL DESKTOP (1024px - 1279px)
   ======================================== */
@media (min-width: 1024px) and (max-width: 1279px) {
    .container {
        max-width: 960px;
    }

    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 4rem;
    }
}

/* ========================================
   DESKTOP (1280px+)
   ======================================== */
@media (min-width: 1280px) {
    .menu-toggle {
        display: none;
    }

    .container {
        max-width: 1200px;
    }

    .apps-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero-title {
        font-size: 5rem;
    }
}

/* ========================================
   LARGE DESKTOP (1536px+)
   ======================================== */
@media (min-width: 1536px) {
    .container {
        max-width: 1400px;
    }

    .apps-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-xl);
    }

    .hero-section {
        padding: var(--space-3xl) var(--space-xl);
    }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATIONS
   ======================================== */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets */
    .btn {
        min-height: 48px;
        padding: var(--space-md) var(--space-xl);
    }

    .nav-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Disable hover effects on touch */
    .app-card:hover {
        transform: none;
    }

    .app-card:active {
        transform: scale(0.98);
    }

    .btn:hover {
        transform: none;
    }

    .btn:active {
        transform: scale(0.98);
    }

    /* Remove 3D tilt on touch devices */
    .app-card {
        transform: none !important;
    }
}

/* ========================================
   LANDSCAPE MOBILE
   ======================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 120px var(--space-lg) var(--space-xl);
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        margin-bottom: var(--space-md);
    }
}

/* ========================================
   HIGH DPI / RETINA
   ======================================== */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    /* Sharper borders */
    .app-card,
    .stat-card,
    .feature-card {
        border-width: 0.5px;
    }
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    body {
        background: white;
        color: black;
    }

    .site-header,
    .site-footer,
    .hero-buttons,
    .cta-section {
        display: none;
    }

    .hero-section {
        min-height: auto;
        padding: 20px;
    }

    .app-card {
        break-inside: avoid;
        border: 1px solid #ccc;
    }
}

/* ========================================
   SAFE AREA (iPhone X+, Notched Devices)
   ======================================== */
@supports (padding: max(0px)) {
    .site-header {
        padding-top: max(var(--space-md), env(safe-area-inset-top));
        padding-left: max(var(--space-md), env(safe-area-inset-left));
        padding-right: max(var(--space-md), env(safe-area-inset-right));
    }

    .site-footer {
        padding-bottom: max(var(--space-xl), env(safe-area-inset-bottom));
    }

    .nav-menu {
        padding-bottom: max(var(--space-lg), env(safe-area-inset-bottom));
    }
}

/* ========================================
   DARK MODE RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (prefers-color-scheme: light) {
    /* Users with light mode preference can still see luxury dark theme */
    /* No changes needed - theme is dark by design */
}

/* ========================================
   ACCESSIBILITY - FOCUS VISIBLE
   ======================================== */
@media (scripting: none) {

    /* Fallback for no-JS */
    .menu-toggle {
        display: none;
    }

    .nav-menu {
        display: flex !important;
        position: static;
        flex-wrap: wrap;
    }
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

.btn:focus-visible,
.app-card:focus-visible,
.nav-menu a:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

/* ========================================
   CONTAINER QUERIES (Future-Ready)
   ======================================== */
@supports (container-type: inline-size) {
    .apps-section {
        container-type: inline-size;
    }

    @container (min-width: 600px) {
        .apps-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    @container (min-width: 900px) {
        .apps-grid {
            grid-template-columns: repeat(3, 1fr);
        }
    }
}