/**
 * Responsive CSS
 * 
 * @package ProshnoBinimoy
 */

/* Extra Small Devices (phones, 480px and down) */
@media (max-width: 480px) {
    /* Typography */
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.125rem;
    }
    
    /* Layout */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Cards */
    .question-card, .answer-card {
        padding: 1rem;
    }
    
    /* Buttons */
    .btn-primary, .btn-secondary {
        padding: 0.375rem 0.875rem;
        font-size: 0.75rem;
    }
    
    /* Forms */
    input, textarea, select {
        font-size: 16px; /* Prevents zoom on focus */
    }
    
    /* Tables */
    .responsive-table {
        overflow-x: auto;
        display: block;
    }
}

/* Small Devices (phones, 640px and down) */
@media (max-width: 640px) {
    /* Hide on mobile */
    .hide-mobile {
        display: none;
    }
    
    /* Show on mobile */
    .show-mobile {
        display: block;
    }
    
    /* Grid */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    /* Sidebar */
    .sidebar {
        position: static;
        width: 100%;
        margin-top: 1.5rem;
    }
    
    /* Hero Section */
    .hero-section {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.875rem;
    }
    
    /* Stats Cards */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    /* Tags */
    .tag-list {
        flex-wrap: wrap;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) {
    /* Show on desktop */
    .hide-desktop {
        display: none;
    }
    
    /* Grid */
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Large Devices (desktops, 1024px and up) */
@media (min-width: 1024px) {
    .container {
        max-width: 1280px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Sticky Sidebar */
    .sticky-sidebar {
        position: sticky;
        top: 5rem;
    }
}

/* Extra Large Devices (large desktops, 1280px and up) */
@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
    
    .grid-5 {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .grid-6 {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Touch Devices */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    button, 
    .btn, 
    a, 
    .clickable {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch */
    .hover\:translate-y-1:hover {
        transform: none;
    }
    
    .hover\:shadow-lg:hover {
        box-shadow: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #111827;
        color: #e5e7eb;
    }
    
    .bg-white {
        background-color: #1f2937;
    }
    
    .border-gray-200 {
        border-color: #374151;
    }
    
    .text-gray-800, .text-gray-900 {
        color: #f3f4f6;
    }
    
    .text-gray-600, .text-gray-500 {
        color: #9ca3af;
    }
    
    .bg-gray-50, .bg-gray-100 {
        background-color: #1f2937;
    }
    
    input, textarea, select {
        background-color: #111827;
        border-color: #374151;
        color: #f3f4f6;
    }
}

/* Print Styles */
@media print {
    header, footer, aside, .floating-btn, .hero-section {
        display: none;
    }
    
    body, main {
        background: white;
        color: black;
        padding: 0;
        margin: 0;
    }
    
    a {
        text-decoration: none;
        color: black;
    }
    
    .question-card, .answer-card {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ddd;
        margin-bottom: 1rem;
        padding: 1rem;
    }
}