/* Responsive Design Styles for B M Upadhyay Shiksha Samiti */

/* Enhanced Header Responsiveness - Universal Header Styles */
#main-header {
    transition: all 0.3s ease;
    transform: translateY(0);
    will-change: auto;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Ensure all header elements have smooth transitions */
#main-header .header-logo,
#main-header .header-title,
#main-header .header-subtitle,
#main-header .container {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop Header Scrolled State */
#main-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 0.5rem 0;
    transition: all 0.3s ease;
}

#main-header.scrolled .container {
    padding: 0.5rem 1rem;
}

#main-header.scrolled .header-logo {
    height: 3rem;
    width: 3rem;
    transition: all 0.3s ease;
}

#main-header.scrolled .header-title {
    font-size: 1.25rem;
    line-height: 1.3;
    transition: all 0.3s ease;
}

#main-header.scrolled .header-subtitle {
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

/* Mobile Header Responsiveness */
@media (max-width: 640px) {
    #main-header {
        padding: 0.25rem 0;
        /* Prevent header jumping and layout issues on mobile */
        min-height: 60px;
    }
    
    #main-header .container {
        padding: 0.5rem 0.75rem;
    }
    
    #main-header .header-logo {
        height: 2.5rem;
        width: 2.5rem;
        transition: all 0.3s ease;
    }
    
    #main-header .header-title {
        font-size: 0.875rem;
        line-height: 1.2;
        transition: all 0.3s ease;
    }
    
    #main-header .header-subtitle {
        font-size: 0.75rem;
        line-height: 1.1;
        transition: all 0.3s ease;
    }
    
    #main-header.scrolled {
        min-height: 50px;
        padding: 0.125rem 0;
        background: rgba(255, 255, 255, 0.98);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        transition: all 0.3s ease;
    }
    
    #main-header.scrolled .container {
        padding: 0.25rem 0.75rem;
    }
    
    #main-header.scrolled .header-logo {
        height: 2rem;
        width: 2rem;
        transition: all 0.3s ease;
    }
    
    #main-header.scrolled .header-title {
        font-size: 0.75rem;
        transition: all 0.3s ease;
    }
    
    #main-header.scrolled .header-subtitle {
        font-size: 0.625rem;
        transition: all 0.3s ease;
    }
}

/* Tablet Header Responsiveness */
@media (min-width: 641px) and (max-width: 768px) {
    #main-header {
        padding: 0.5rem 0;
        transition: all 0.3s ease;
    }
    
    #main-header .container {
        padding: 0.5rem 1rem;
    }
    
    #main-header .header-logo {
        height: 3rem;
        width: 3rem;
        transition: all 0.3s ease;
    }
    
    #main-header .header-title {
        font-size: 1.125rem;
        line-height: 1.2;
        transition: all 0.3s ease;
    }
    
    #main-header .header-subtitle {
        font-size: 0.75rem;
        transition: all 0.3s ease;
    }
    
    #main-header.scrolled {
        padding: 0.25rem 0;
        background: rgba(255, 255, 255, 0.98);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    }
    
    #main-header.scrolled .container {
        padding: 0.25rem 1rem;
    }
    
    #main-header.scrolled .header-logo {
        height: 2.5rem;
        width: 2.5rem;
    }
    
    #main-header.scrolled .header-title {
        font-size: 1rem;
        line-height: 1.2;
    }
    
    #main-header.scrolled .header-subtitle {
        font-size: 0.675rem;
    }
}

/* Large Desktop Header Responsiveness */
@media (min-width: 1024px) {
    #main-header {
        padding: 1rem 0;
        transition: all 0.3s ease;
    }
    
    #main-header .container {
        padding: 1rem 1.5rem;
    }
    
    #main-header .header-logo {
        height: 4rem;
        width: 4rem;
        transition: all 0.3s ease;
    }
    
    #main-header .header-title {
        font-size: 2rem;
        line-height: 1.2;
        transition: all 0.3s ease;
    }
    
    #main-header .header-subtitle {
        font-size: 1rem;
        transition: all 0.3s ease;
    }
    
    #main-header.scrolled {
        padding: 0.5rem 0;
        background: rgba(255, 255, 255, 0.95);
        -webkit-backdrop-filter: blur(15px);
        backdrop-filter: blur(15px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
    
    #main-header.scrolled .container {
        padding: 0.5rem 1.5rem;
    }
    
    #main-header.scrolled .header-logo {
        height: 3rem;
        width: 3rem;
    }
    
    #main-header.scrolled .header-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    #main-header.scrolled .header-subtitle {
        font-size: 0.875rem;
    }
}

/* Extra Large Desktop Header Responsiveness */
@media (min-width: 1280px) {
    #main-header {
        padding: 1.25rem 0;
    }
    
    #main-header .container {
        padding: 1.25rem 2rem;
    }
    
    #main-header .header-logo {
        height: 5rem;
        width: 5rem;
    }
    
    #main-header .header-title {
        font-size: 2.5rem;
        line-height: 1.1;
    }
    
    #main-header .header-subtitle {
        font-size: 1.25rem;
    }
    
    #main-header.scrolled {
        padding: 0.75rem 0;
    }
    
    #main-header.scrolled .container {
        padding: 0.75rem 2rem;
    }
    
    #main-header.scrolled .header-logo {
        height: 3.5rem;
        width: 3.5rem;
    }
    
    #main-header.scrolled .header-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    #main-header.scrolled .header-subtitle {
        font-size: 1rem;
    }
}

/* Touch-Friendly Navigation */
.course-btn {
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

@media (max-width: 640px) {
    .course-btn {
        font-size: 1rem;
        padding: 1rem 1.5rem;
        margin: 0.5rem 0;
    }
}

/* Enhanced Mobile Menu */
#mobile-menu {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
}

#mobile-menu a {
    display: block;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

#mobile-menu a:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

#mobile-menu a.font-semibold {
    background: linear-gradient(135deg, #478ac9, #2563eb);
    color: white;
}

/* Responsive Typography */
@media (max-width: 1024px) {
    .text-4xl.md\:text-6xl {
        font-size: 2.5rem;
    }
    
    .text-xl.md\:text-2xl {
        font-size: 1.125rem;
    }
}

@media (max-width: 768px) {
    .text-4xl.md\:text-6xl {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .text-xl.md\:text-2xl {
        font-size: 1rem;
    }
    
    .text-3xl {
        font-size: 1.75rem;
    }
    
    .text-2xl {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .text-4xl.md\:text-6xl {
        font-size: 1.75rem;
    }
    
    .text-3xl {
        font-size: 1.5rem;
    }
    
    .text-2xl {
        font-size: 1.25rem;
    }
    
    .text-xl {
        font-size: 1.125rem;
    }
}

/* Enhanced Button Responsiveness */
.btn, .course-btn, .contact-card, .achievement-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 768px) {
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    .course-btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
        width: 100%;
        text-align: center;
    }
    
    .course-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* Grid Responsiveness */
@media (max-width: 1024px) {
    .grid.lg\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .grid.lg\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid.md\:grid-cols-2,
    .grid.md\:grid-cols-3,
    .grid.md\:grid-cols-4 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .grid.lg\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Contact Cards Responsiveness */
@media (max-width: 768px) {
    .contact-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .contact-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 0.75rem;
    }
    
    .contact-title {
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
    }
}

/* FAQ Accordion Responsive */
@media (max-width: 768px) {
    .accordion-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .accordion-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .accordion-icon {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
    
    .accordion-content div {
        padding: 1rem;
    }
}

/* Image Responsiveness */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }
    
    .h-80 {
        height: 16rem;
    }
    
    .h-96 {
        height: 20rem;
    }
}

@media (max-width: 480px) {
    .h-80 {
        height: 12rem;
    }
    
    .h-96 {
        height: 16rem;
    }
}

/* Map Responsiveness */
@media (max-width: 768px) {
    .map-container iframe {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .map-container iframe {
        height: 200px;
    }
}

/* Footer Responsiveness */
@media (max-width: 768px) {
    footer .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    footer .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    footer h3,
    footer h4 {
        margin-bottom: 1rem;
    }
    
    footer ul {
        margin-bottom: 2rem;
    }
}

/* Touch and Gesture Support */
@media (hover: none) and (pointer: coarse) {
    .hover\:scale-105:hover {
        transform: scale(1.02);
    }
    
    .hover\:shadow-xl:hover {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    }
    
    .course-btn:hover {
        transform: scale(1.02);
    }
}

/* Landscape Mode Fixes */
@media (max-height: 500px) and (orientation: landscape) {
    .py-20 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .py-16 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    #main-header {
        position: fixed;
        padding: 0.5rem 0;
    }
    
    #main-header h1 {
        font-size: 1.25rem;
    }
    
    #main-header p {
        font-size: 0.875rem;
    }
    
    #main-header img {
        height: 2.5rem;
        width: 2.5rem;
    }
}

/* Performance Optimizations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast; /* Safari/WebKit & Edge */
        image-rendering: pixelated; /* Modern browsers */
    }
}

/* Dark Mode Support Removed - Using Light Mode Only */

/* Accessibility Improvements */
@media (prefers-contrast: high) {
    .text-primary {
        color: #1e40af;
    }
    
    .text-gray-700 {
        color: #374151;
    }
    
    .border-gray-200 {
        border-color: #6b7280;
    }
}

/* Print Styles */
@media print {
    header,
    footer,
    #mobile-menu-btn,
    .course-btn {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black;
        background: white;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .shadow-lg,
    .shadow-xl {
        box-shadow: none;
    }
}