/* ===========================
   Responsive Design
   Mobile-first approach
   =========================== */

/* Mobile (default styles in main.css) */

/* Small devices (640px and up) */
@media (min-width: 640px) {
    .hero {
        padding: 120px 0 var(--spacing-3xl);
    }

    .auth-card {
        padding: var(--spacing-3xl);
    }
}

/* Medium devices (768px and up) */
@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .hero-actions {
        flex-wrap: nowrap;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps {
        grid-template-columns: 1fr auto 1fr auto 1fr;
    }

    .pricing-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large devices (1024px and up) */
@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .generate-layout {
        grid-template-columns: 1fr 1fr;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* Extra large devices (1280px and up) */
@media (min-width: 1280px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

/* Tablet Landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .hero {
        min-height: 80vh;
    }
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .hero-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .stat {
        padding: var(--spacing-md) 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .stat:last-child {
        border-bottom: none;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .pricing-featured {
        transform: none;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--spacing-lg);
    }

    .dashboard-filters {
        flex-direction: column;
        width: 100%;
    }

    .filter-group,
    .search-box {
        width: 100%;
    }

    .form-footer {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: flex-start;
    }

    .social-auth {
        flex-direction: column;
    }

    .social-auth .btn {
        width: 100%;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 20px auto;
        padding: var(--spacing-xl);
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .nav-actions {
        gap: var(--spacing-sm);
    }

    .nav-actions .btn-ghost {
        display: none;
        /* Hide 'Sign In' ghost on mobile nav to save space */
    }

    .user-menu {
        right: var(--spacing-md);
        width: calc(100vw - 40px);
        max-width: 300px;
    }
}

/* Specific fix for the logo on small screens */
@media (max-width: 480px) {
    .logo-text {
        font-size: 1.1rem;
    }

    .logo-icon {
        font-size: 1.2rem;
    }

    .navbar .container {
        padding: 0 var(--spacing-md);
    }

    .btn-large {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.75rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-links a {
        padding: var(--spacing-sm) 0;
    }

    .feature-card:hover {
        transform: none;
    }

    .gallery-item:hover {
        transform: none;
    }

    .gallery-overlay {
        opacity: 1;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .logo-icon {
        filter: drop-shadow(0 0 6px var(--primary));
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .gradient-orb {
        animation: none;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Already dark by default */
}

/* Print styles */
@media print {

    .navbar,
    .mobile-menu,
    .footer,
    .btn,
    .hero-background {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .hero-content {
        color: black;
    }
}