/* Mobile First Responsive Design - Deepak Chauhan x AI Bhai */

/* Tablets and Small Laptops */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 15px;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 18px;
    }
    
    .main-intro h2,
    .user-intent h3,
    .categories-title h3 {
        font-size: 1.8rem;
    }
    
    .intro-text {
        padding: 20px;
        font-size: 16px;
    }
    
    .intent-btn {
        min-width: 160px;
        padding: 15px 20px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .main-header {
        padding: 0.8rem 0;
    }
    
    .header-container {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
        text-align: center;
    }
    
    .brand-human {
        justify-content: center;
        order: 1;
        min-width: auto;
    }
    
    .brand-ai {
        justify-content: center;
        order: 2;
        min-width: auto;
    }
    
    .collab-center {
        order: 0;
        margin: 10px 0;
        min-width: auto;
    }
    
    .language-section {
        order: 3;
        margin-top: 0;
        width: 100%;
    }
    
    .human-info {
        text-align: center;
    }
    
    .ai-info {
        text-align: center;
    }
    
    .brand-human, .brand-ai {
        flex-direction: row;
        gap: 12px;
    }
    
    .avatar-human, .avatar-ai {
        width: 50px;
        height: 50px;
    }
    
    .human-info h1, .ai-info h1 {
        font-size: 1.1rem;
    }
    
    .human-info p, .ai-info p {
        font-size: 0.8rem;
    }
    
    .dk {
        font-size: 1.8rem;
    }
    
    .community {
        font-size: 1.4rem;
    }
    
    .collab-bridge {
        gap: 8px;
    }
    
    .bridge-line {
        max-width: 60px;
    }
    
    .collab-icon {
        font-size: 1.2rem;
    }
    
    .collab-text span {
        font-size: 0.8rem;
    }
    
    .category-group {
        gap: 8px;
    }
    
    .category-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        min-width: 140px;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .image-card img {
        height: 220px;
    }
    
    .image-hover {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
    
    /* New Sections Mobile */
    .main-intro, .user-intent {
        padding: 40px 15px;
    }
    
    .intent-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .intent-btn {
        width: 90%;
        min-width: auto;
    }
    
    .footer-purpose {
        margin: 30px auto;
        padding: 20px;
    }
    
    /* Navigation buttons */
    .nav-buttons {
        justify-content: center;
        width: 100%;
    }
    
    .updates-btn, .nav-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    .main-header {
        padding: 8px 0 !important;
        min-height: auto !important;
        height: auto !important;
        position: relative !important;
    }
    
    .header-container {
        padding: 0 10px;
        flex-direction: column;
        gap: 8px !important;
        align-items: center;
    }
    
    .brand-human, .brand-ai {
        flex-direction: row;
        gap: 8px;
        justify-content: center;
        align-items: center;
        width: 100%;
        max-width: 200px;
    }
    
    .avatar-human, .avatar-ai {
        width: 35px;
        height: 35px;
        flex-shrink: 0;
    }
    
    .human-info h1, .ai-info h1 {
        font-size: 0.9rem;
        margin: 0;
        line-height: 1.2;
    }
    
    .human-info p, .ai-info p {
        font-size: 0.65rem;
        margin: 0;
        display: none; /* Hide on mobile to save space */
    }
    
    .collab-center {
        order: -1;
        margin: 0;
        width: 100%;
    }
    
    .dk {
        font-size: 1.3rem;
    }
    
    .community {
        font-size: 1rem;
    }
    
    .collab-bridge {
        margin: 3px 0;
        gap: 5px;
    }
    
    .bridge-line {
        max-width: 40px;
        height: 1px;
    }
    
    .collab-icon {
        font-size: 0.9rem;
    }
    
    .collab-text span {
        font-size: 0.65rem;
        line-height: 1.1;
    }
    
    .language-section {
        margin-top: 0;
        gap: 5px;
        flex-direction: row;
        justify-content: center;
        width: 100%;
    }
    
    .language-switcher select {
        min-width: 110px;
        padding: 6px 25px 6px 30px;
        font-size: 0.8rem;
    }
    
    .nav-buttons {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .nav-btn {
        width: 100%;
        text-align: center;
        padding: 10px;
    }
    
    .updates-section {
        width: 100%;
        text-align: center;
    }
    
    .updates-btn {
        width: 100%;
        justify-content: center;
    }
    
    .nav-container {
        padding: 0 10px;
    }
    
    .category-group {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
    
    .category-btn {
        width: 180px;
        justify-content: center;
        margin: 1px 0;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .content-container {
        padding: 0 10px;
    }
    
    .image-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
        margin-top: 10px;
    }
    
    .image-card img {
        height: 180px;
    }
    
    .quick-download, .quick-share {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    /* New Sections Small Mobile */
    .main-intro, .user-intent {
        padding: 30px 10px;
    }
    
    .main-intro h2,
    .user-intent h3,
    .categories-title h3 {
        font-size: 1.4rem;
    }
    
    .intro-text {
        padding: 15px;
        font-size: 14px;
    }
    
    .intent-btn {
        padding: 12px 15px;
        font-size: 14px;
        min-width: 140px;
    }
    
    .intent-btn span:first-child {
        font-size: 1.5rem;
    }
    
    .footer-purpose {
        padding: 15px;
        margin: 20px auto;
        font-size: 14px;
    }
    
    /* Ensure content is visible */
    .main-content {
        padding: 10px 0 !important;
        min-height: calc(100vh - 120px) !important;
    }
    
    .modal-container {
        width: 98%;
        margin: 2% auto;
        border-radius: 0;
        height: 100vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 12px;
        position: sticky;
        top: 0;
        z-index: 1;
    }
    
    .modal-image {
        max-height: 50vh;
    }
    
    .image-overlay {
        position: relative;
        bottom: auto;
        right: auto;
        justify-content: center;
        margin: 12px 0;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .overlay-btn {
        width: 90%;
    }
    
    .modal-info {
        padding: 12px;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* Small Mobile Phones */
@media (max-width: 320px) {
    .main-header {
        padding: 5px 0 !important;
    }
    
    .header-container {
        gap: 5px !important;
    }
    
    .brand-human, .brand-ai {
        gap: 5px;
        max-width: 150px;
    }
    
    .avatar-human, .avatar-ai {
        width: 30px;
        height: 30px;
    }
    
    .human-info h1, .ai-info h1 {
        font-size: 0.8rem;
    }
    
    .dk {
        font-size: 1.1rem;
    }
    
    .community {
        font-size: 0.9rem;
    }
    
    .category-btn {
        min-width: 120px;
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .image-card img {
        height: 160px;
    }
    
    .main-intro h2,
    .user-intent h3,
    .categories-title h3 {
        font-size: 1.2rem;
    }
    
    .intro-text {
        padding: 12px;
        font-size: 13px;
    }
    
    .intent-btn {
        min-width: 120px;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .main-content {
        min-height: calc(100vh - 100px) !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .image-hover {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }

    .quick-download, .quick-share {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .category-btn, .action-btn, .nav-btn, .updates-btn {
        padding: 14px 20px;
        min-height: 44px;
    }

    /* Better touch targets */
    button, .image-card, .overlay-btn, .intent-btn {
        min-height: 44px;
    }
}

/* Landscape Mode */
@media (max-height: 500px) and (orientation: landscape) {
    .ai-loader-content {
        transform: scale(0.8);
    }

    .collab-animation {
        flex-direction: row;
        gap: 30px;
    }

    .avatar {
        width: 70px;
        height: 70px;
    }

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

    .modal-image {
        max-height: 40vh;
    }
    
    /* Adjust new sections for landscape */
    .main-intro, .user-intent {
        padding: 20px;
    }
    
    .intent-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .intent-btn {
        min-width: 120px;
    }
}

/* Print Styles */
@media print {
    .main-header, .categories-nav, .language-section,
    .modal-close, .image-hover, .ad-container,
    .updates-section, .nav-buttons {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .image-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .image-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    .image-card img {
        height: 200px !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #f9fafb;
        --text-light: #d1d5db;
        --bg-light: #1f2937;
        --bg-white: #111827;
    }

    .main-header {
        background: rgba(17, 24, 39, 0.95);
    }
    
    .categories-nav {
        background: #1f2937;
        border-bottom: 1px solid #374151;
    }

    .category-btn {
        background: #374151;
        color: #f9fafb;
        border-color: #4b5563;
    }

    .category-btn.active,
    .category-btn:hover {
        background: linear-gradient(135deg, var(--human-color), var(--ai-color));
        color: white;
    }

    .image-card {
        background: #1f2937;
        border: 1px solid #374151;
    }

    .image-info h3 {
        color: #f9fafb;
    }

    .image-info p {
        color: #d1d5db;
    }
    
    /* New sections dark mode */
    .main-intro {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        border-bottom-color: #334155;
    }
    
    .intro-text {
        background: #1e293b;
        color: #cbd5e1;
    }
    
    .user-intent {
        background: #111827;
    }
    
    .intent-btn {
        background: #1e293b;
        border-color: #334155;
        color: #cbd5e1;
    }
    
    .intent-btn:hover {
        background: #0f172a;
        border-color: var(--human-color);
    }
    
    .categories-section {
        background: #0f172a;
    }
    
    .footer-purpose {
        background: #1e293b;
        color: #cbd5e1;
    }
}