/* =============================
   RESPONSIVE DESIGN STYLES
   ============================= */

/* Extra Large Devices (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .support-card {
        height: 220px;
    }
}

/* Large Devices (1200px and up) */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .hero-title {
        font-size: 3.5rem;
    }
    
    .support-card {
        height: 200px;
    }
}

/* Medium Devices (992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .hero-section {
        height: 55vh;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .support-card {
        height: 180px;
    }
    
    .search-input {
        font-size: 1rem;
    }
}

/* Small Devices (768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-section {
        height: 50vh;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .quick-links {
        justify-content: center;
        text-align: center;
    }
    
    .quick-link {
        margin: 0.25rem 0.5rem;
    }
    
    .support-card {
        height: 160px;
        margin-bottom: 1rem;
    }
    
    .content-sections .row {
        flex-direction: column;
    }
    
    .event-item {
        margin-bottom: 1rem;
    }
    
    .book-card {
        margin-bottom: 1.5rem;
    }
    
    .contact-card,
    .help-card,
    .social-card {
        margin-bottom: 1.5rem;
    }
}

/* Extra Small Devices (576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-section {
        height: 45vh;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .search-input {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }
    
    .search-btn {
        padding: 0.875rem 1.5rem;
    }
    
    .quick-links {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .divider {
        display: none;
    }
    
    .support-card {
        height: 140px;
        margin-bottom: 1rem;
    }
    
    .support-title {
        font-size: 0.9rem;
    }
    
    .event-image img {
        height: 80px;
    }
    
    .book-cover {
        aspect-ratio: 2.5/3.5;
    }
    
    .contact-card,
    .help-card,
    .social-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
}

/* Extra Small Devices (less than 576px) */
@media (max-width: 575.98px) {
    .hero-section {
        height: 40vh;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .search-section {
        padding: 1.5rem 0;
    }
    
    .search-input {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        border-radius: 25px 0 0 25px;
    }
    
    .search-btn {
        padding: 0.75rem 1.25rem;
        border-radius: 0 25px 25px 0;
    }
    
    .quick-access-section {
        padding: 1rem 0;
    }
    
    .quick-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .quick-link {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    .divider {
        display: none;
    }
    
    .support-services {
        padding: 2rem 0;
    }
    
    .support-card {
        height: 120px;
        margin-bottom: 0.75rem;
    }
    
    .support-title {
        font-size: 0.85rem;
    }
    
    .content-sections {
        padding: 2rem 0;
    }
    
    .content-wrapper {
        padding: 1rem !important;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .event-item {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .event-image img {
        height: 70px;
    }
    
    .event-title {
        font-size: 0.9rem;
    }
    
    .event-date,
    .event-description {
        font-size: 0.8rem;
    }
    
    .book-card {
        margin-bottom: 1rem;
    }
    
    .book-cover {
        aspect-ratio: 2/3;
    }
    
    .book-title {
        font-size: 0.85rem;
    }
    
    .book-author {
        font-size: 0.75rem;
    }
    
    .bottom-contact-section {
        padding: 2rem 0;
    }
    
    .contact-card,
    .help-card,
    .social-card {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .contact-title,
    .help-title,
    .social-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .social-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .social-buttons .btn {
        width: 100%;
        text-align: center;
    }
}

/* =============================
   HEADER RESPONSIVE STYLES
   ============================= */

/* Tablet Specific Styles */
@media (min-width: 768px) and (max-width: 991.98px) {
    .top-bar {
        display: block !important;
        padding: 8px 0;
    }
    
    .top-bar .contact-info span {
        font-size: 13px;
    }
    
    .top-bar .btn-outline-primary {
        font-size: 12px;
        padding: 4px 12px;
    }
    
    .navbar-brand .logo-img {
        height: 80px;
        margin-top: -30px;
        margin-bottom: -30px;
    }
    
    .navbar-brand .logo-text h4 {
        font-size: 16px;
    }
    
    .navbar-nav .nav-link {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .modern-dropdown {
        min-width: 280px;
    }
    
    .search-btn .btn {
        width: 38px;
        height: 38px;
    }
    
    .profile-nav-item .nav-link {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 991.98px) {
    .top-bar {
        display: none !important;
    }
    
    .navbar-brand .logo-img {
        height: 60px;
        margin-top: -20px;
        margin-bottom: -20px;
    }
    
    .navbar-brand .logo-text h4 {
        font-size: 1.2rem;
    }
    
    .navbar-brand .logo-text small {
        font-size: 0.75rem;
    }
    
    .navbar-collapse {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--light-dark);
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid #f0f0f0;
    }
    
    /* Ensure dropdowns are hidden by default on mobile */
    .dropdown-menu,
    .modern-dropdown {
        position: static !important;
        transform: none !important;
        border: none;
        box-shadow: none;
        background: var(--light-color);
        margin-top: 0.5rem;
        display: none; /* Hide by default */
    }
    
    /* Show when active */
    .dropdown-menu.show,
    .modern-dropdown.show {
        display: block;
    }
    
    .dropdown-item {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .search-btn {
        margin-top: 1rem;
    }
    
    .search-btn .btn {
        width: 100%;
        height: 50px;
        border-radius: 8px;
    }
}

/* =============================
   FOOTER RESPONSIVE STYLES
   ============================= */

@media (max-width: 767.98px) {
    .footer-widget {
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .footer-widget h5 {
        margin-bottom: 1rem;
    }
    
    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .footer-links a {
        margin: 0.25rem 0.5rem;
    }
    
    .hours-item {
        justify-content: center;
        text-align: center;
    }
    
    .newsletter-form .input-group {
        flex-direction: column;
    }
    
    .newsletter-form .form-control {
        border-radius: var(--border-radius) !important;
        margin-bottom: 0.5rem;
    }
    
    .newsletter-form .btn {
        border-radius: var(--border-radius) !important;
    }
    
    .social-links {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .footer-bottom {
        text-align: center;
    }
    
    .footer-bottom .row > div {
        margin-bottom: 1rem;
    }
}

/* =============================
   ACCESSIBILITY & FOCUS STYLES
   ============================= */

@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;
    }
    
    .support-card:hover {
        transform: none;
    }
    
    .book-card:hover {
        transform: none;
    }
    
    .event-item:hover {
        transform: none;
    }
}

@media (prefers-contrast: high) {
    .hero-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .support-overlay {
        background: rgba(0, 0, 0, 0.8) !important;
    }
    
    .book-overlay {
        background: rgba(0, 0, 0, 0.9);
    }
}

/* Focus styles for keyboard navigation */
.search-input:focus,
.quick-link:focus,
.support-card:focus,
.book-card:focus,
.event-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* =============================
   PRINT STYLES
   ============================= */

@media print {
    .hero-section,
    .search-section,
    .quick-access-section,
    .support-services,
    .bottom-contact-section {
        display: none !important;
    }
    
    .content-sections {
        background: white !important;
        color: black !important;
    }
    
    .event-item,
    .book-card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
    
    .section-title {
        color: black !important;
        border-bottom-color: #ccc !important;
    }
    
    a {
        text-decoration: underline !important;
        color: black !important;
    }
    
    img {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* =============================
   DARK MODE SUPPORT
   ============================= */

@media (prefers-color-scheme: dark) {
    .dark-mode-preferred .content-sections {
        background: #1f2937 !important;
        color: #f9fafb !important;
    }
    
    .dark-mode-preferred .event-item {
        background: #374151 !important;
        border-color: #4b5563 !important;
        color: #ebebeb !important;
    }
    
    .dark-mode-preferred .section-title {
        color: #000000 !important;
    }
    
    .dark-mode-preferred .event-title {
        color: #000000 !important;
    }
    
    .dark-mode-preferred .book-title {
        color: #000000 !important;
    }
}
