/* Responsive Styles for Dumdum UDAAN */

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    /* Typography */
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.4rem; }
    h4 { font-size: 1.2rem; }
    h5 { font-size: 1.1rem; }
    
    /* Navbar */
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-brand img {
        height: 40px;
    }
    
    .navbar-nav .btn {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
    
    /* Hero Slider */
    .slider-container {
        height: 400px;
    }
    
    .slider-content {
        padding: 20px;
    }
    
    .slider-content h1 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    .slider-content p {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    /* Sections */
    .section {
        padding: 40px 0;
    }
    
    .section-title h2 {
        font-size: 1.8rem;
    }
    
    /* Counters */
    .counter-box {
        padding: 20px 10px;
        margin-bottom: 20px;
    }
    
    .counter-box h3 {
        font-size: 2rem;
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Blog Cards */
    .blog-card {
        margin-bottom: 20px;
    }
    
    /* Forms */
    .contact-form,
    .contact-info {
        padding: 20px 15px;
    }
    
    /* Footer */
    footer .row > div {
        margin-bottom: 30px;
    }
    
    .footer-links {
        text-align: left;
    }
    
    /* CTA Section */
    .cta-content h3 {
        font-size: 1.8rem;
    }
    
    .cta-buttons .btn {
        display: block;
        margin: 10px 0;
        width: 100%;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.8rem; }
    
    .slider-container {
        height: 450px;
    }
    
    .slider-content h1 {
        font-size: 2.2rem;
    }
    
    .section {
        padding: 50px 0;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .counter-box {
        padding: 25px 15px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2.2rem; }
    
    .slider-container {
        height: 500px;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Admin Panel */
    #sidebar {
        width: 220px;
    }
    
    main {
        margin-left: 220px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .cta-section,
    .btn,
    .no-print {
        display: none !important;
    }
    
    body {
        padding-top: 0 !important;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .section {
        padding: 20px 0 !important;
        page-break-inside: avoid;
    }
    
    a {
        color: #000 !important;
        text-decoration: none !important;
    }
    
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Use higher resolution images */
    .logo img {
        transform: scale(0.5);
        transform-origin: 0 0;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .slider-content {
        animation: none !important;
    }
}

/* Dark mode preference */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #e0e0e0;
        --text-light: #a0a0a0;
        --light-color: #2a2a2a;
        --dark-color: #f8f9fa;
    }
    
    body {
        background-color: #121212;
        color: var(--text-color);
    }
    
    .card {
        background-color: #1e1e1e;
        color: var(--text-color);
    }
    
    .form-control {
        background-color: #2a2a2a;
        border-color: #444;
        color: var(--text-color);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        padding: 12px 20px; /* Larger touch targets */
    }
    
    .nav-link {
        padding: 10px 15px !important;
    }
    
    /* Disable hover effects on touch devices */
    .gallery-item:hover,
    .blog-card:hover {
        transform: none;
    }
    
    /* Increase font sizes for better readability */
    body {
        font-size: 16px;
    }
}

/* Foldable devices */
@media (max-width: 350px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .navbar-brand .brand-text {
        font-size: 1rem;
    }
}

/* Admin Panel Responsive */
@media (max-width: 768px) {
    /* Admin Panel */
    #sidebar {
        position: fixed;
        width: 100%;
        height: 100%;
        top: var(--navbar-height);
        left: -100%;
        transition: left 0.3s ease;
        z-index: 1000;
    }
    
    #sidebar.show {
        left: 0;
    }
    
    main {
        margin-left: 0;
        padding-top: 10px;
    }
    
    .table-responsive {
        font-size: 14px;
    }
    
    .modal-dialog {
        margin: 10px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-bottom: 5px;
    }
    
    /* DataTables */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: center;
        margin-top: 10px;
    }
}

/* Admin Panel - Large Screens */
@media (min-width: 1200px) {
    #sidebar {
        width: 280px;
    }
    
    /*main {*/
    /*    margin-left: 280px;*/
    /*}*/
}

/* Admin Panel - Medium Screens */
@media (min-width: 769px) and (max-width: 1199px) {
    #sidebar {
        width: 240px;
    }
    
    main {
        margin-left: 240px;
    }
}

/* Dashboard Stats */
@media (max-width: 992px) {
    .stat-card .card-text {
        font-size: 1.8rem;
    }
    
    .stat-card .card-icon {
        font-size: 2.5rem;
    }
}

/* Form elements on mobile */
@media (max-width: 576px) {
    .form-control,
    .form-select {
        font-size: 16px; /* Prevent iOS zoom on focus */
    }
    
    .summernote .note-editable {
        min-height: 200px;
    }
    
    /* Admin tables */
    .dataTables_wrapper table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Action buttons in tables */
    .table td .btn {
        margin-bottom: 5px;
        display: inline-block;
    }
}

/* Landscape orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .slider-container {
        height: 300px;
    }
    
    .section {
        padding: 30px 0;
    }
    
    .navbar {
        padding: 5px 0;
    }
    
    .hero-slider .slider-content {
        padding: 20px;
    }
}

/* Portrait orientation */
@media (orientation: portrait) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .counter-box {
        padding: 20px;
    }
}

/* Very large screens */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Small height screens */
@media (max-height: 600px) {
    .slider-container {
        height: 350px;
    }
    
    .hero-slider .slider-content h1 {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    .hero-slider .slider-content p {
        font-size: 1rem;
        margin-bottom: 15px;
    }
}

/* Admin login page responsive */
@media (max-width: 768px) {
    .login-card {
        margin: 20px;
    }
    
    .login-header {
        padding: 30px 20px;
    }
    
    .login-body {
        padding: 30px 20px;
    }
}

/* Fix for iOS Safari 100vh issue */
@supports (-webkit-touch-callout: none) {
    .login-container {
        min-height: -webkit-fill-available;
    }
}