/* Lexi Studio - Responsive Design */

/* Large Devices (Desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Medium Devices (Tablets, 992px to 1199px) */
@media (max-width: 1199px) {
    :root {
        --section-padding: 80px;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Small Devices (Tablets, 768px to 991px) */
@media (max-width: 991px) {
    :root {
        --section-padding: 60px;
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 320px;
        height: 100vh;
        background: var(--bg-darker);
        flex-direction: column;
        padding: 100px 30px 30px;
        gap: 5px;
        transition: var(--transition-normal);
        z-index: 999;
        overflow-y: auto;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.3);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-link {
        padding: 15px 20px;
        font-size: 1.1rem;
        border-radius: var(--radius-md);
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: var(--bg-card);
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-overlay {
        display: block;
    }
    
    /* Hero Section */
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    
    .hero-content {
        order: 2;
    }
    
    .hero-image {
        order: 1;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    /* Grid Layouts */
    .grid-2,
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    /* Dashboard */
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .dashboard-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
        position: fixed;
        bottom: 30px;
        right: 30px;
        width: 60px;
        height: 60px;
        background: var(--gradient-primary);
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.5rem;
        box-shadow: var(--shadow-lg);
        z-index: 998;
    }
    
    /* Cart */
    .cart-container {
        grid-template-columns: 1fr;
    }
    
    .cart-summary {
        position: relative;
        top: 0;
    }
    
    /* Script Detail */
    .script-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .script-gallery {
        position: relative;
        top: 0;
    }
}

/* Extra Small Devices (Phones, 767px and down) */
@media (max-width: 767px) {
    /* Typography */
    .section-title {
        font-size: 2rem;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    /* Grid Layouts */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    /* Buttons */
    .btn-lg {
        padding: 14px 30px;
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    /* Stats */
    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    /* Cards */
    .card-image {
        height: 180px;
    }
    
    /* Cart */
    .cart-header {
        display: none;
    }
    
    .cart-item {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .cart-product {
        width: 100%;
    }
    
    .cart-quantity,
    .cart-price,
    .cart-total {
        display: flex;
        justify-content: space-between;
        width: 100%;
        align-items: center;
    }
    
    .cart-quantity::before {
        content: 'Quantity:';
        font-weight: 600;
        color: var(--text-muted);
    }
    
    .cart-price::before {
        content: 'Price:';
        font-weight: 600;
        color: var(--text-muted);
    }
    
    .cart-total::before {
        content: 'Total:';
        font-weight: 600;
        color: var(--text-muted);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-bottom-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Auth Pages */
    .auth-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    /* Marketplace */
    .marketplace-filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* Script Detail */
    .script-info h1 {
        font-size: 1.8rem;
    }
    
    .script-meta-detail {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .script-actions-detail {
        flex-direction: column;
    }
    
    .price-tag {
        font-size: 2rem;
    }
    
    /* Dashboard */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    /* WhatsApp Float */
    .whatsapp-float {
        width: 55px;
        height: 55px;
        font-size: 26px;
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-tooltip {
        display: none;
    }
}

/* Very Small Devices (Small Phones, 575px and down) */
@media (max-width: 575px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .script-image {
        height: 180px;
    }
    
    .thumbnail-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .auth-logo h1 {
        font-size: 1.5rem;
    }
    
    .cart-product {
        flex-direction: column;
        text-align: center;
    }
    
    .cart-product img {
        width: 100%;
        height: 150px;
    }
}

/* Landscape Mode */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 100px 0 60px;
    }
    
    .hero-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .nav-menu {
        padding-top: 80px;
    }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .whatsapp-float,
    .preloader {
        display: none !important;
    }
    
    .main-content {
        padding-top: 0;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card {
        break-inside: avoid;
        border: 1px solid #ddd;
    }
}

/* Dark Mode Support (System Preference) */
@media (prefers-color-scheme: light) {
    /* Keep dark theme as default brand identity */
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .preloader {
        display: none !important;
    }
}

/* Custom Scrollbar for Mobile */
@media (hover: none) and (pointer: coarse) {
    ::-webkit-scrollbar {
        width: 6px;
    }
    
    .cursor-dot,
    .cursor-outline {
        display: none;
    }
}
