/* Universal Responsive CSS for Bhanubhakta School Website */

/* Base Responsive Rules */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    font-size: 16px;
    line-height: 1.6;
}

.container {
    max-width: 100%;
    padding: 0 15px;
}

/* Ensure images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Prevent horizontal scroll */
.row {
    margin-left: 0;
    margin-right: 0;
}

.col, [class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
}

/* Typography Responsive */
@media (max-width: 1200px) {
    .display-1 { font-size: 4rem; }
    .display-2 { font-size: 3.5rem; }
    .display-3 { font-size: 3rem; }
    .display-4 { font-size: 2.5rem; }
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }
    .lead { font-size: 1.2rem; }
    .hero-title { font-size: 3rem !important; }
    .page-title { font-size: 2.5rem !important; }
}

@media (max-width: 768px) {
    .display-1 { font-size: 3rem; }
    .display-2 { font-size: 2.5rem; }
    .display-3 { font-size: 2rem; }
    .display-4 { font-size: 1.8rem; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.1rem; }
    .lead { font-size: 1.1rem; }
    p { font-size: 0.95rem; }
    .container { padding: 0 1rem; }
    .hero-title { font-size: 2.5rem !important; line-height: 1.2 !important; }
    .page-title { font-size: 2rem !important; }
    .section-title { font-size: 1.8rem !important; }
}

@media (max-width: 480px) {
    .display-1 { font-size: 2.5rem; }
    .display-2 { font-size: 2rem; }
    .display-3 { font-size: 1.8rem; }
    .display-4 { font-size: 1.6rem; }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.3rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    .lead { font-size: 1rem; }
    p { font-size: 0.9rem; }
    small { font-size: 0.8rem; }
}

/* Navigation Responsive */
@media (max-width: 992px) {
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    .navbar-toggler:focus {
        box-shadow: none;
    }
}

@media (max-width: 768px) {
    .navbar-brand-modern { font-size: 1.4rem !important; }
    .navbar-nav .nav-link { 
        padding: 0.8rem 1rem !important; 
        text-align: center;
        margin: 0.2rem 0;
        border-radius: 10px;
        color: rgba(255, 255, 255, 0.9) !important;
        transition: all 0.3s ease !important;
    }
    
    .navbar-nav .nav-link:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        color: #ffffff !important;
        transform: translateX(5px) !important;
    }
    
    .navbar-nav .nav-link.active {
        background: rgba(255, 255, 255, 0.2) !important;
        color: #ffffff !important;
        font-weight: 600 !important;
    }
    .navbar-collapse { 
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
        border-radius: 15px; 
        margin-top: 1rem; 
        padding: 1rem;
        backdrop-filter: blur(10px);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    .navbar-nav {
        gap: 0.5rem;
    }
}

/* Hero Section Responsive */
@media (max-width: 992px) {
    .hero-section { 
        min-height: 85vh !important; 
        padding: 3rem 0 !important;
    }
    .hero-content { 
        text-align: center;
        margin-bottom: 3rem;
    }
}

@media (max-width: 768px) {
    .hero-section { 
        min-height: 80vh !important; 
        text-align: center !important; 
        padding: 2rem 0 !important;
    }
    .floating-element { display: none !important; }
    .hero-content { margin-bottom: 2rem; }
    .hero-image { margin-top: 2rem; }
    .hero-badge { 
        font-size: 0.85rem !important;
        padding: 0.6rem 1.2rem !important;
    }
}

@media (max-width: 480px) {
    .hero-section { 
        min-height: 70vh !important; 
        padding: 1.5rem 0 !important;
    }
    .hero-badge { 
        font-size: 0.8rem !important;
        padding: 0.5rem 1rem !important;
    }
}

/* Buttons Responsive */
@media (max-width: 992px) {
    .btn-modern, .btn-hero-primary, .btn-hero-outline {
        padding: 1rem 2rem !important;
        font-size: 0.95rem !important;
        margin-bottom: 0.5rem !important;
    }
}

@media (max-width: 768px) {
    .btn-modern, .btn-hero-primary, .btn-hero-outline {
        width: 100% !important;
        margin-bottom: 1rem !important;
        padding: 1rem !important;
        font-size: 0.9rem !important;
    }
    .d-flex.gap-3, .d-flex.gap-4 {
        flex-direction: column !important;
        gap: 0 !important;
    }
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .btn-modern, .btn-hero-primary, .btn-hero-outline {
        padding: 0.8rem !important;
        font-size: 0.85rem !important;
    }
}

/* Cards Responsive */
@media (max-width: 992px) {
    .card, .feature-card, .event-card, .team-card, .contact-card {
        margin-bottom: 1.5rem !important;
    }
}

@media (max-width: 768px) {
    .card, .feature-card, .event-card, .team-card, .contact-card {
        margin-bottom: 2rem !important;
    }
    .glass-card { padding: 2rem !important; }
    .contact-hero-card {
        margin-top: 2rem !important;
        padding: 2rem !important;
    }
    .hero-main-card {
        margin-top: 2rem !important;
        transform: none !important;
    }
}

@media (max-width: 480px) {
    .glass-card { padding: 1.5rem !important; }
    .card-body { padding: 1.5rem !important; }
    .contact-hero-card {
        padding: 1.5rem !important;
    }
}

/* Icons Responsive */
@media (max-width: 768px) {
    .feature-icon, .contact-icon {
        width: 70px !important;
        height: 70px !important;
        font-size: 1.8rem !important;
    }
    .hero-icon-bg, .calendar-icon {
        width: 100px !important;
        height: 100px !important;
    }
    .hero-icon-bg i, .calendar-icon i {
        font-size: 3rem !important;
    }
}

@media (max-width: 480px) {
    .feature-icon, .contact-icon {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.5rem !important;
    }
    .hero-icon-bg, .calendar-icon {
        width: 80px !important;
        height: 80px !important;
    }
    .hero-icon-bg i, .calendar-icon i {
        font-size: 2.5rem !important;
    }
}

/* Stats Responsive */
@media (max-width: 768px) {
    .stat-card, .stat-item {
        margin-bottom: 2rem !important;
        padding: 1.5rem !important;
    }
    .stat-number {
        font-size: 2.5rem !important;
    }
}

@media (max-width: 480px) {
    .stat-number {
        font-size: 2rem !important;
    }
}

/* Forms Responsive */
@media (max-width: 768px) {
    .form-control, .form-select {
        padding: 1rem !important;
        font-size: 1rem !important;
        border-radius: 10px !important;
    }
    .form-group {
        margin-bottom: 1.5rem !important;
    }
    .form-floating-icon {
        right: 12px !important;
    }
}

@media (max-width: 480px) {
    .form-control, .form-select {
        padding: 0.8rem !important;
        font-size: 0.9rem !important;
    }
    .form-label {
        font-size: 0.9rem !important;
    }
}

/* Tables Responsive */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.85rem !important;
    }
    .table th, .table td {
        padding: 0.5rem !important;
    }
}

/* Sections Responsive */
@media (max-width: 992px) {
    .section-padding {
        padding: 80px 0 !important;
    }
}

@media (max-width: 768px) {
    .section-padding {
        padding: 60px 0 !important;
    }
}

@media (max-width: 480px) {
    .section-padding {
        padding: 40px 0 !important;
    }
}

/* Gallery Responsive */
@media (max-width: 768px) {
    .gallery-item {
        margin-bottom: 1rem !important;
    }
    .gallery-image {
        height: 200px !important;
    }
}

@media (max-width: 480px) {
    .gallery-image {
        height: 150px !important;
    }
}

/* Footer Responsive */
@media (max-width: 768px) {
    .footer {
        text-align: center !important;
    }
    .footer .col-md-6 {
        margin-bottom: 2rem !important;
    }
}

/* Admin Panel Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100% !important;
        transform: translateX(-100%) !important;
        position: fixed !important;
        height: 100vh !important;
        z-index: 9999 !important;
    }
    .sidebar.show {
        transform: translateX(0) !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 1rem !important;
    }
    .mobile-menu-toggle {
        display: block !important;
    }
    .admin-card {
        margin-bottom: 1rem !important;
    }
    .admin-table {
        font-size: 0.85rem !important;
    }
}

/* Utility Classes */
@media (max-width: 992px) {
    .text-center-tablet { text-align: center !important; }
    .d-block-tablet { display: block !important; }
    .w-100-tablet { width: 100% !important; }
}

@media (max-width: 768px) {
    .text-center-mobile { text-align: center !important; }
    .d-block-mobile { display: block !important; }
    .w-100-mobile { width: 100% !important; }
    .mb-3-mobile { margin-bottom: 1rem !important; }
    .p-2-mobile { padding: 0.5rem !important; }
    .flex-column-mobile { flex-direction: column !important; }
    .gap-mobile { gap: 1rem !important; }
}

/* Animation Adjustments for Mobile */
@media (max-width: 992px) {
    .floating-element {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .floating-element,
    .achievement-card {
        display: none !important;
    }
    
    .hero-main-card {
        margin-top: 2rem !important;
        transform: none !important;
        animation: none !important;
    }
    
    /* Disable complex animations on mobile for better performance */
    * {
        animation-duration: 0.3s !important;
    }
    
    .card:hover {
        transform: translateY(-5px) !important;
    }
}

/* Touch Improvements */
@media (hover: none) and (pointer: coarse) {
    .btn, .nav-link, .card {
        transition: background-color 0.2s ease !important;
    }
    
    .btn:hover, .nav-link:hover {
        transform: none !important;
    }
    
    .card:hover {
        transform: translateY(-2px) !important;
    }
    
    /* Improve touch targets */
    .btn {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    .nav-link {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
    }
}

/* Additional Mobile Optimizations */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .col, [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* Improve readability on small screens */
    body {
        font-size: 14px;
    }
    
    .small, small {
        font-size: 0.8rem;
    }
}

/* Landscape phone optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: 60vh !important;
    }
    
    .navbar-collapse {
        max-height: 50vh;
        overflow-y: auto;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-container img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Print styles */
@media print {
    .navbar, .floating-element, .btn, .hero-section {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: none !important;
    }
}