/* ============================================
   NSBM Library Management Portal - Homepage Styles
   ============================================ */

/* ============================================
   HOMEPAGE CSS RESET AND FORCE OVERRIDES
   ============================================ */

/* High-specificity reset for homepage content sections only */
body.homepage main .content-sections,
body.homepage .content-sections {
    background: #f9fafb !important;
    background-color: #f9fafb !important;
    color: #1f2937 !important;
}

body.homepage main .content-sections .content-wrapper,
body.homepage .content-sections .content-wrapper {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1f2937 !important;
}

body.homepage main .content-sections .section-title,
body.homepage .content-sections .section-title,
body.homepage main .content-sections h1,
body.homepage .content-sections h1,
body.homepage main .content-sections h2,
body.homepage .content-sections h2,
body.homepage main .content-sections h3,
body.homepage .content-sections h3 {
    color: #1e40af !important;
    background: transparent !important;
    background-color: transparent !important;
    text-shadow: none !important;
}

/* Force text content to be dark - homepage only */
body.homepage main .content-sections p,
body.homepage .content-sections p,
body.homepage main .content-sections .event-description,
body.homepage .content-sections .event-description,
body.homepage main .content-sections .news-excerpt,
body.homepage .content-sections .news-excerpt {
    color: #1f2937 !important;
}

/* Homepage-specific body class targeting */
body.homepage .content-sections {
    background: #f9fafb !important;
    background-color: #f9fafb !important;
    color: #1f2937 !important;
}

body.homepage .content-wrapper {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1f2937 !important;
}

/* Override pages-common.css section-title styles for homepage */
body.homepage .section-title,
body.homepage .content-sections .section-title {
    color: #1e40af !important;
    background: transparent !important;
    background-color: transparent !important;
    text-align: left !important;
    font-size: 1.75rem !important;
    margin-bottom: 2rem !important;
    border-bottom: 3px solid #1e40af !important;
    padding-bottom: 0.5rem !important;
    display: inline-block !important;
}

body.homepage .section-title::after,
body.homepage .content-sections .section-title::after {
    content: '' !important;
    position: absolute !important;
    bottom: -3px !important;
    left: 0 !important;
    transform: none !important;
    width: 50px !important;
    height: 3px !important;
    background: #f59e0b !important;
}

body.homepage .content-sections * {
    color: inherit !important;
}

body.homepage .content-sections h1,
body.homepage .content-sections h2,
body.homepage .content-sections h3,
body.homepage .content-sections h4,
body.homepage .content-sections h5,
body.homepage .content-sections h6 {
    color: #1e40af !important;
}

body.homepage .content-sections p,
body.homepage .event-description,
body.homepage .news-excerpt {
    color: #1f2937 !important;
}

/* TEST - High visibility override to verify styles are loading */
body.homepage .content-sections {
    border: 3px solid rgb(41, 151, 241) !important;
    background: #d3d5d8 !important;
}

body.homepage .section-title {
    background: yellow !important;
    color: #1e40af !important;
    padding: 10px !important;
}

/* Remove Bootstrap CSS Custom Properties - Updated to match global styles */
:root {
    --primary-color: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --info-color: #3b82f6;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --white-color: #ffffff;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-heavy: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Body and Layout */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white-color);
    overflow-x: hidden;
    padding-top: 0; /* Remove default padding */
}

/* Main content positioning */
main {
    position: relative;
    z-index: 1;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    transition: top 0.3s;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* ============================================
   HEADER ADJUSTMENTS
   ============================================ */

/* Ensure navbar is fixed and has proper z-index */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 30px rgba(0,0,0,0.15);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
    position: relative;
    min-height: 50vh; /* Reduced from 100vh to 50vh */
    display: flex;
    align-items: center;
    justify-content: center; /* Center content horizontally */
    overflow: hidden;
    margin-top: 0; /* Remove any top margin that might interfere with navigation */
    padding-top: 120px; /* Increased padding to push text below navigation */
    padding-bottom: 80px; /* Increased bottom padding for balance */
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.1); /* Initial scale for zoom effect */
    transition: transform 0.1s ease-out;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(30, 64, 175, 0.2) 0%,
        rgba(59, 130, 246, 0.2) 50%,
        rgba(16, 185, 129, 0.2) 100%
    );
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 20px 0; /* Added top padding to push content down */
    text-align: center;
    width: 100%;
    margin-top: 1rem; /* Additional top margin for better positioning */
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-shadow: 3px 3px 8px rgba(0,0,0,0.4), 1px 1px 4px rgba(0,0,0,0.6);
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0.95;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.4), 1px 1px 3px rgba(0,0,0,0.6);
    animation: fadeInUp 1s ease-out 0.3s both;
}

/* Hero Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   SEARCH SECTION
   ============================================ */

.search-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    position: relative;
    z-index: 10;
    margin-top: -60px; /* Pull the search section up to overlap with hero */
    padding-top: 80px; /* Add padding to compensate for the negative margin */
    padding-bottom: 40px;
}

.search-bar-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-form-main {
    width: 100%;
    display: flex;
    justify-content: center;
}

.search-form-main .input-group {
    box-shadow: var(--shadow-heavy);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: stretch;
}

.search-input {
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    flex: 1;
    min-width: 0; /* Allows proper flexbox shrinking */
}

.search-input:focus {
    box-shadow: none;
    background: var(--white-color);
    outline: none;
}

.search-input::placeholder {
    color: #6b7280;
    opacity: 1;
}

.search-btn {
    border: none;
    padding: 1rem 2rem;
    background: var(--accent-color);
    color: var(--dark-color);
    font-weight: 600;
    transition: var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
}

.search-btn:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.search-btn:focus {
    outline: none;
    background: #e0a800;
}

/* ============================================
   SEARCH SUGGESTIONS DROPDOWN
   ============================================ */

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white-color);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    box-shadow: var(--shadow-heavy);
    z-index: 1000;
    max-height: 500px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border-top: 1px solid var(--border-color);
}

.search-suggestions.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-suggestions::-webkit-scrollbar {
    width: 8px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: var(--light-color);
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.suggestion-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--white-color);
}

.suggestion-item:last-child {
    border-bottom: none;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: rgba(30, 64, 175, 0.05);
    color: var(--primary-color);
    transform: translateX(5px);
}

.suggestion-item.no-results {
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    cursor: default;
}

.suggestion-item.no-results:hover {
    background: var(--white-color);
    transform: none;
    color: var(--text-muted);
}

.suggestion-image {
    width: 50px;
    height: 70px;
    border-radius: var(--border-radius);
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.suggestion-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.suggestion-image .book-placeholder {
    color: var(--text-muted);
    font-size: 1.5rem;
    opacity: 0.6;
}

.suggestion-content {
    flex: 1;
    min-width: 0;
}

.suggestion-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
    word-break: break-word;
}

.suggestion-title mark {
    background: rgba(255, 193, 7, 0.3);
    color: var(--primary-color);
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 700;
}

.suggestion-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.suggestion-author {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.suggestion-category {
    color: var(--info-color);
    font-size: 0.85rem;
    font-weight: 500;
}

.suggestion-match {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.match-type {
    background: rgba(30, 64, 175, 0.1);
    color: var(--primary-color);
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.availability {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.availability.available {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.availability.unavailable {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.suggestion-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.2s ease;
}

.suggestion-item:hover .suggestion-actions,
.suggestion-item.selected .suggestion-actions {
    opacity: 1;
    transform: translateX(0);
}

.suggestion-actions .btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.suggestion-actions .view-details-btn {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.suggestion-actions .view-details-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.suggestion-actions .reserve-btn {
    background: var(--primary-color);
    color: white;
}

.suggestion-actions .reserve-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.4);
}

.suggestion-actions .btn:disabled {
    background: rgba(108, 117, 125, 0.1);
    color: var(--text-muted);
    cursor: not-allowed;
}

.suggestion-actions .btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* No results styling */
.suggestion-item.no-results .suggestion-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.suggestion-item.no-results .suggestion-icon {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.suggestion-item.no-results .suggestion-action {
    flex-shrink: 0;
}

/* View all results styling */
.suggestion-item.view-all-results {
    background: rgba(0, 123, 255, 0.05);
    border-top: 2px solid rgba(0, 123, 255, 0.1);
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
}

.suggestion-item.view-all-results:hover {
    background: rgba(0, 123, 255, 0.1);
    transform: none;
}

.suggestion-item.view-all-results .suggestion-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.suggestion-item.view-all-results .suggestion-icon {
    font-size: 1.1rem;
    color: var(--primary-color);
}

.suggestion-item.view-all-results .suggestion-action {
    flex-shrink: 0;
}

.suggestion-item.view-all-results .suggestion-action .btn {
    background: var(--primary-color);
    border: none;
    font-size: 0.85rem;
    padding: 0.375rem 0.75rem;
}

.suggestion-item.view-all-results .suggestion-action .btn:hover {
    background: var(--primary-dark);
    transform: translateX(3px);
}

/* Responsive design for suggestions */
@media (max-width: 768px) {
    .search-suggestions {
        max-height: 400px;
        left: -10px;
        right: -10px;
        border-radius: 0 0 12px 12px;
    }
    
    .suggestion-item {
        padding: 0.875rem 1rem;
        gap: 0.75rem;
    }
    
    .suggestion-image {
        width: 40px;
        height: 56px;
    }
    
    .suggestion-title {
        font-size: 0.9rem;
    }
    
    .suggestion-meta {
        gap: 0.5rem;
        margin-bottom: 0.375rem;
    }
    
    .suggestion-author,
    .suggestion-category {
        font-size: 0.8rem;
    }
    
    .suggestion-actions {
        gap: 0.25rem;
    }
    
    .suggestion-actions .btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .suggestion-item {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .suggestion-image {
        width: 35px;
        height: 49px;
    }
    
    .suggestion-title {
        font-size: 0.85rem;
        line-height: 1.25;
    }
    
    .suggestion-meta {
        flex-direction: column;
        gap: 0.25rem;
        margin-bottom: 0.25rem;
    }
    
    .suggestion-match {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.375rem;
    }
    
    .match-type,
    .availability {
        font-size: 0.7rem;
    }
}

/* ============================================
   QUICK ACCESS SECTION - IMPROVED MOBILE
   ============================================ */

.quick-access-section {
    background: var(--light-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    max-width: 100%;
}

.quick-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.quick-link:hover {
    color: var(--white-color);
    background: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(30, 77, 107, 0.3);
    border-color: var(--primary-color);
}

.quick-link i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

.divider {
    color: var(--text-muted);
    font-weight: 300;
    margin: 0 0.5rem;
}

/* ============================================
   SUPPORT SERVICES SECTION - UPDATED FOR LINKS
   ============================================ */

.support-services {
    background: var(--white-color);
}

.support-card {
    position: relative !important;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    height: 280px;
    display: block;
    text-decoration: none;
    color: inherit;
}

.support-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-heavy);
    text-decoration: none;
    color: inherit;
}

.support-image {
    position: relative !important;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: block;
}

.support-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.support-card:hover .support-image img {
    transform: scale(1.05);
}

.support-overlay {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.95), rgba(59, 130, 246, 0.95));
    backdrop-filter: blur(10px);
    color: #ffffff;
    padding: 0.75rem 1rem;
    transform: translateY(0);
    transition: var(--transition);
    border-top: 3px solid var(--accent-color);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
    height: auto !important;
    min-height: 50px;
    max-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-title {
    font-weight: 700;
    margin: 0;
    font-size: 0.9rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    color: #ffffff;
    text-align: center;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.2;
    display: block;
    width: 100%;
}

/* Specific styling for Well-being Support to keep text on one line */
.wellbeing-support .support-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem; /* Slightly smaller font size to fit better */
}

/* Support card hover effects */
.support-card:hover .support-overlay {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.98), rgba(59, 130, 246, 0.98));
    border-top-color: #fbbf24;
    transform: translateY(-2px);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.4);
    min-height: 55px;
}

.support-card:hover .support-title {
    color: #fbbf24;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Force support overlay to bottom - additional specificity */
.support-services .support-card .support-image .support-overlay {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 50px !important;
    max-height: 80px !important;
}

/* Ensure proper container setup */
.support-services .support-card .support-image {
    position: relative !important;
    height: 100% !important;
    width: 100% !important;
}

/* Override any full-height overlay styles */
.support-services .support-card .support-overlay {
    height: auto !important;
    top: auto !important;
    transform: none !important;
}

/* ============================================
   CONTENT SECTIONS - FIXED BUTTON OVERLAP
   ============================================ */

/* ============================================
   CONTENT SECTIONS - FORCE CORRECT COLORS
   ============================================ */

/* Override any theme or conflicting styles for content sections */
body .content-sections,
.content-sections {
    background: var(--light-color) !important;
    background-color: #f9fafb !important;
    padding: 3rem 0 !important;
    color: var(--text-dark) !important;
}

body .content-wrapper,
.content-wrapper {
    background: var(--white-color) !important;
    background-color: #ffffff !important;
    border-radius: var(--border-radius-lg) !important;
    box-shadow: var(--shadow-light) !important;
    margin: 1rem !important;
    height: auto !important;
    min-height: 600px !important;
    display: flex !important;
    flex-direction: column !important;
    transition: all 0.3s ease !important;
    overflow: hidden !important;
    color: var(--text-dark) !important;
}

body .content-wrapper:hover,
.content-wrapper:hover {
    transform: translateY(-5px) !important;
    box-shadow: var(--shadow-medium) !important;
}

/* Force correct text colors for section titles */
body .section-title,
.section-title,
body .content-sections .section-title,
.content-sections .section-title {
    color: var(--primary-color) !important;
    color: #1e40af !important;
    font-weight: 600 !important;
    margin-bottom: 2rem !important;
    padding-bottom: 0.5rem !important;
    border-bottom: 3px solid var(--primary-color) !important;
    border-bottom-color: #1e40af !important;
    position: relative !important;
    background: none !important;
    background-color: transparent !important;
}

body .section-title::after,
.section-title::after {
    content: '' !important;
    position: absolute !important;
    bottom: -3px !important;
    left: 0 !important;
    width: 50px !important;
    height: 3px !important;
    background: var(--accent-color) !important;
    background-color: #f59e0b !important;
}

/* Force correct colors for all text content in content sections */
body .content-sections *,
.content-sections * {
    color: inherit !important;
}

body .content-sections h1,
body .content-sections h2,
body .content-sections h3,
body .content-sections h4,
body .content-sections h5,
body .content-sections h6,
.content-sections h1,
.content-sections h2,
.content-sections h3,
.content-sections h4,
.content-sections h5,
.content-sections h6 {
    color: var(--text-dark) !important;
    color: #1f2937 !important;
}

body .content-sections p,
.content-sections p {
    color: var(--text-dark) !important;
    color: #1f2937 !important;
}

/* Make sure wrapper content has proper text colors */
body .content-wrapper .p-4,
.content-wrapper .p-4 {
    color: var(--text-dark) !important;
    color: #1f2937 !important;
}

/* ============================================
   SPECIFIC OVERRIDES FOR AOS ANIMATED ELEMENTS
   ============================================ */

/* Force correct colors for AOS animated elements */
body .section-title.mb-4.aos-init.aos-animate,
.section-title.mb-4.aos-init.aos-animate,
body [data-aos] .section-title,
[data-aos] .section-title,
body .aos-init.aos-animate,
.aos-init.aos-animate {
    color: var(--primary-color) !important;
    color: #1e40af !important;
    background: none !important;
    background-color: transparent !important;
}

/* Override any dark theme or conflicting styles */
body .content-sections .aos-init,
.content-sections .aos-init,
body .content-sections .aos-animate,
.content-sections .aos-animate {
    color: var(--text-dark) !important;
    color: #1f2937 !important;
}

/* Specific override for section titles with AOS classes */
body h3.section-title,
h3.section-title,
body .content-sections h3,
.content-sections h3 {
    color: var(--primary-color) !important;
    color: #1e40af !important;
    background: transparent !important;
    text-shadow: none !important;
}

/* Remove any background colors from containers that might be dark */
body .content-sections .container-fluid,
.content-sections .container-fluid,
body .content-sections .row,
.content-sections .row,
body .content-sections .col-lg-4,
.content-sections .col-lg-4 {
    background: none !important;
    background-color: transparent !important;
    color: inherit !important;
}

/* ============================================
   HOMEPAGE-SPECIFIC OVERRIDES (TO AVOID AFFECTING OTHER PAGES)
   ============================================ */

/* Only apply these styles to the homepage to avoid affecting other pages */
body.homepage .content-sections,
body:not(.page-template) .content-sections {
    background: #f9fafb !important;
    color: #1f2937 !important;
}

body.homepage .content-wrapper,
body:not(.page-template) .content-wrapper {
    background: #ffffff !important;
    color: #1f2937 !important;
}

body.homepage .section-title,
body:not(.page-template) .section-title {
    color: #1e40af !important;
    background: transparent !important;
}

/* If homepage doesn't have specific body class, target by content structure */
.content-sections[data-homepage="true"] {
    background: #f9fafb !important;
    color: #1f2937 !important;
}

.content-sections[data-homepage="true"] .content-wrapper {
    background: #ffffff !important;
    color: #1f2937 !important;
}

.content-sections[data-homepage="true"] .section-title {
    color: #1e40af !important;
    background: transparent !important;
}

/* Content wrapper padding and structure - restored */
body .content-wrapper .p-4,
.content-wrapper .p-4 {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 2rem !important;
    min-height: 550px !important;
    color: var(--text-dark) !important;
    color: #1f2937 !important;
}

/* Ultimate override for any remaining issues */
.content-sections * {
    box-sizing: border-box;
}

.content-sections,
.content-sections *:not(.btn):not(.badge):not(.alert) {
    background-color: inherit !important;
}

.content-sections .bg-light {
    background-color: #f9fafb !important;
}

.content-sections .bg-white {
    background-color: #ffffff !important;
}

.content-sections .text-dark {
    color: #1f2937 !important;
}

.content-sections .text-primary {
    color: #1e40af !important;
}

/* List containers should expand to fill space */
.events-list, .news-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 450px;
    margin-bottom: 1.5rem;
}

/* New Arrivals grid container */
.content-wrapper .row.g-3 {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    margin: 0 !important;
    min-height: 450px;
    margin-bottom: 1.5rem !important;
}

/* View All buttons should always be at bottom and never overlap */
.content-wrapper .text-center.mt-4 {
    margin-top: auto !important;
    padding: 1.5rem 0 0 !important;
    flex-shrink: 0 !important;
    margin-bottom: 0 !important;
    border-top: 1px solid var(--border-color);
    background: rgba(248, 249, 250, 0.8);
    margin-left: -2rem !important;
    margin-right: -2rem !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
}

/* Ensure consistent button styling across all columns */
.content-wrapper .btn {
    min-width: 180px !important;
    padding: 0.875rem 1.5rem !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    border-radius: var(--border-radius-lg) !important;
}

.content-wrapper .btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

/* Book cards in New Arrivals - Fixed Width and Auto Height */
.book-card {
    width: 100% !important; /* Fill the column container */
    height: auto !important; /* Auto height based on content */
    min-height: 300px !important; /* Minimum height to maintain consistency */
    display: flex !important;
    flex-direction: column !important;
    transition: all 0.3s ease !important;
    margin-bottom: 1.5rem !important;
    background: var(--white-color) !important;
    border-radius: var(--border-radius-lg) !important;
    box-shadow: var(--shadow-light) !important;
    overflow: hidden !important;
    position: relative !important;
}

/* Make book content area flexible with auto height */
.book-card .book-content {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    padding: 1rem !important;
    min-height: auto !important; /* Auto height based on content */
}

/* Ensure book images have consistent aspect ratio */
.book-card .book-image {
    height: 180px !important; /* Fixed height for consistent image sizes */
    overflow: hidden !important;
    position: relative !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    flex-shrink: 0 !important; /* Prevent image container from shrinking */
}

.book-card .book-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

/* Make book titles consistent height */
.book-card .book-title {
    height: 2.4rem; /* Fixed height for titles */
    line-height: 1.2;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Book hover effects */
.book-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.book-card:hover .book-image img {
    transform: scale(1.1);
}

/* Book status styling */
.book-status {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    z-index: 2;
}

.book-status.unavailable {
    background: rgba(220, 53, 69, 0.9);
}

/* Ensure book grid columns have equal height and width */
.content-wrapper .row.g-3 {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    margin: 0 !important; /* Remove any margin conflicts */
}

/* Remove conflicting Bootstrap column styles */
.content-wrapper .row.g-3 .col-lg-6 {
    display: flex !important;
    margin-bottom: 1rem !important;
    align-items: stretch !important;
    flex: none !important; /* Remove flex grow */
    width: 48% !important; /* Fixed consistent width */
    max-width: 48% !important;
    padding: 0 0.5% !important; /* Consistent padding */
}

/* Make sure the entire column structure maintains equal heights */
.arrivals-list .row {
    flex: 1 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    justify-content: space-between !important;
}

/* Override any Bootstrap conflicts for book grid - FIXED WIDTH */
.content-wrapper .row.g-3 .col-lg-6,
.content-wrapper .row.g-3 .col-md-6,
.content-wrapper .row.g-3 .col-sm-6,
.arrivals-list .col-lg-6,
.arrivals-list .col-md-6,
.arrivals-list .col-sm-6 {
    flex: none !important;
    width: 48% !important; /* Fixed width for consistent layout */
    max-width: 48% !important;
    min-width: 48% !important;
    margin-bottom: 1rem !important;
    padding: 0 0.5% !important; /* Small padding to create gap */
}

/* Ensure book grid maintains consistent spacing */
.content-wrapper .row.g-3 {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: stretch !important;
    margin: 0 !important;
    gap: 0 !important; /* Remove gap class conflicts */
}

/* ============================================
   LAYOUT FIXES - FINAL OVERRIDES
   ============================================ */

/* Ensure no content overflow or conflicts */
.content-sections .container-fluid {
    overflow: hidden !important;
}

/* Fix any text wrapping issues */
.event-title, .news-title, .book-title {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Ensure consistent margins and padding */
.content-wrapper .p-4 > *:last-child:not(.text-center) {
    margin-bottom: 0 !important;
}

/* Remove any conflicting max-heights that cause scrolling */
.event-list, .news-list, .arrivals-list {
    max-height: none !important;
    overflow: visible !important;
}

/* Ensure images don't break layout */
.event-image img, .book-image img {
    max-width: 100% !important;
    height: auto !important;
}


.event-description, .news-excerpt {
    line-height: 1.6;
    margin-bottom: 1rem;
}

.section-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--accent-color);
}

/* ============================================
   EVENTS & NEWS SECTION - CLEAN REBUILD
   ============================================ */

/* ============================================
   EVENTS & NEWS SECTION - CLEAN STYLING
   ============================================ */

body.homepage .event-item {
    background: var(--white-color) !important;
    border-radius: var(--border-radius-lg) !important;
    padding: 1.5rem !important;
    border: 1px solid var(--border-color) !important;
    transition: var(--transition) !important;
    margin-bottom: 1.5rem !important;
    box-shadow: var(--shadow-light) !important;
}

body.homepage .event-item:hover {
    transform: translateY(-3px) !important;
    box-shadow: var(--shadow-medium) !important;
}

body.homepage .event-title {
    color: var(--primary-color) !important;
    font-weight: 600 !important;
    margin-bottom: 0.75rem !important;
    font-size: 1.1rem !important;
    line-height: 1.4 !important;
}

body.homepage .event-date,
body.homepage .event-date .date-badge {
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0.25rem 0 !important;
    margin: 0.5rem 0 !important;
    color: var(--text-muted) !important;
    font-size: 0.85rem !important;
    font-weight: normal !important;
}

body.homepage .event-date .date-badge i {
    color: var(--warning-color) !important;
    margin-right: 0.5rem !important;
}

body.homepage .event-description {
    color: var(--text-dark) !important;
    line-height: 1.6 !important;
    font-size: 0.95rem !important;
    margin: 0 !important;
}

.event-image {
    width: 100%;
    height: 180px;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

body.homepage .event-item:hover .event-image img {
    transform: scale(1.05);
}

/* ============================================
   REDESIGNED NEWS CARDS - CLEAN & READABLE
   ============================================ */

.news-item {
    background: var(--white-color) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius-lg) !important;
    padding: 0 !important;
    margin-bottom: 1.5rem !important;
    box-shadow: var(--shadow-light) !important;
    transition: var(--transition) !important;
    overflow: hidden !important;
    position: relative !important;
    min-height: 180px !important;
    display: flex !important;
    flex-direction: column !important;
    border-left: 4px solid var(--info-color) !important;
}

.news-item:hover {
    transform: translateY(-3px) !important;
    box-shadow: var(--shadow-medium) !important;
    border-left-color: var(--primary-color) !important;
}

.news-item .news-content {
    padding: 1.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    height: 100% !important;
    flex: 1 !important;
}

.news-item .news-title {
    color: var(--primary-color) !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.75rem !important;
    line-height: 1.4 !important;
    transition: color 0.3s ease !important;
}

.news-item:hover .news-title {
    color: var(--primary-dark) !important;
}

.news-item .news-date {
    display: inline-flex !important;
    align-items: center !important;
    color: white !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    margin-top: auto !important;
    margin-bottom: 0 !important;
    /* background: linear-gradient(135deg, var(--info-color), var(--primary-color)) !important; */
    background-color: var(--info-color) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 20px !important;
    align-self: flex-start !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3) !important;
}

.news-item .news-date i {
    margin-right: 0.5rem !important;
    color: var(--info-color) !important;
    font-size: 0.9rem !important;
}

.news-item .news-excerpt {
    color: var(--text-dark) !important;
    line-height: 1.6 !important;
    font-size: 0.95rem !important;
    margin: 0 !important;
    flex-grow: 1 !important;
}

/* Remove any gradient or decorative elements that cause dark backgrounds */
.news-item::before,
.news-item::after {
    display: none !important;
}

.news-item .news-date {
    margin: 0.5rem 0 !important;
    font-size: 0.85rem !important;
    color: #6c757d !important;
}

.news-item .news-excerpt {
    margin: 0 !important;
    line-height: 1.6 !important;
    color: #2c3e50 !important;
}

body.homepage .event-item:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

body.homepage .event-image {
    width: 100%;
    height: 200px;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}

body.homepage .event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

body.homepage .event-item:hover .event-image img {
    transform: scale(1.05);
}

.event-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(30, 77, 107, 0.1) 0%,
        rgba(255, 193, 7, 0.1) 100%
    );
}

.event-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.1rem;
    font-size: 1.1rem;
    text-align: center !important;
    display: block !important;
    padding: 0.1rem 0 !important;
}

/* Event date styling removed - handled by .date-badge */

.event-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-dark);
}

/* ============================================
   NEWS SECTION
   ============================================ */

.news-item {
    background: var(--white-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    margin-bottom: 1rem;
    border-left: 4px solid var(--info-color);
}

.news-item:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
    border-left-color: var(--primary-color);
}

.news-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.news-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.news-date i {
    margin-right: 0.5rem;
    color: var(--info-color);
}

.news-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-dark);
}

/* ============================================
   NEW ARRIVALS SECTION
   ============================================ */

.book-card {
    background: var(--white-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    height: 100%;
    position: relative;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.book-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.book-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.book-card:hover .book-image img {
    transform: scale(1.1);
}

.book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(30, 77, 107, 0.8) 0%,
        rgba(255, 193, 7, 0.8) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.book-card:hover .book-overlay {
    opacity: 1;
}

.book-overlay .btn {
    background: rgba(255,255,255,0.9);
    color: var(--primary-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.book-content {
    padding: 1.5rem;
}

.book-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
    line-height: 1.4;
    height: 2.8rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.book-author {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.book-category {
    display: inline-block;
    background: rgba(30, 77, 107, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Details button for book cards */
.book-card .book-details-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: auto;
}

.book-card .book-details-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

/* ULTIMATE OVERRIDE - Prevent any CSS conflicts with book card widths */
body .content-wrapper .row .col-lg-6,
body .content-wrapper .row .col-md-6, 
body .content-wrapper .row .col-sm-6 {
    flex: none !important;
    width: 48% !important;
    max-width: 48% !important;
    min-width: 48% !important;
}

body .book-card {
    width: 100% !important;
    box-sizing: border-box !important;
}

.book-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.book-status.unavailable {
    background: var(--danger-color);
}

/* ============================================
   BOTTOM CONTACT SECTION
   ============================================ */

.bottom-contact-section {
    background: linear-gradient(135deg, var(--dark-color) 0%, #2c3e50 100%);
    position: relative;
    overflow: hidden;
}

.bottom-contact-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.contact-card,
.help-card,
.social-card {
    background: rgba(255,255,255,0.05);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

.contact-card:hover,
.help-card:hover,
.social-card:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-5px);
}

.contact-title,
.help-title,
.social-title {
    color: white;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.contact-title i,
.help-title i,
.social-title i {
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

.contact-info .contact-item {
    margin-bottom: 1rem;
    color: rgba(255,255,255,0.9);
}

.contact-item h5 {
    color: white;
    margin-bottom: 0.5rem;
}

.help-content p,
.social-content p {
    color: rgba(255,255,255,0.8);
    margin-bottom: 1rem;
}

.social-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-facebook {
    background: #3b5998;
    border-color: #3b5998;
    color: white;
}

.btn-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border: none;
    color: white;
}

.btn-linkedin {
    background: #0077b5;
    border-color: #0077b5;
    color: white;
}

.btn-youtube {
    background: #ff0000;
    border-color: #ff0000;
    color: white;
}

.btn-twitter {
    background: #1da1f2;
    border-color: #1da1f2;
    color: white;
}

.btn-facebook:hover,
.btn-instagram:hover,
.btn-linkedin:hover,
.btn-youtube:hover,
.btn-twitter:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    opacity: 0.9;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* ============================================
   RESPONSIVE DESIGN - ENHANCED MOBILE
   ============================================ */

/* Tablet Styles */
@media (max-width: 991.98px) {
    .hero-section {
        padding-top: 80px;
        min-height: 40vh;
        padding-bottom: 30px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .search-section {
        margin-top: -40px;
        padding-top: 60px;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .search-bar-wrapper {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .search-input {
        padding: 0.875rem 1.25rem;
        font-size: 1.05rem;
    }
    
    .search-btn {
        padding: 0.875rem 1.75rem;
    }
    
    .support-card {
        height: 250px;
        margin-bottom: 1rem;
    }
    
    .content-wrapper {
        margin: 0.5rem;
        min-height: auto;
    }
    
    .content-wrapper .p-4 {
        min-height: auto;
        padding: 1.5rem !important;
    }
    
    .events-list, .news-list {
        min-height: auto;
        margin-bottom: 1rem;
    }
    
    .content-wrapper .row.g-3 {
        min-height: auto;
        margin-bottom: 1rem !important;
    }
    
    /* Enhanced quick links for tablet */
    .quick-links {
        gap: 0.75rem;
        padding: 0 1rem;
    }
    
    .quick-link {
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
        flex: 1;
        justify-content: center;
        min-width: 160px;
    }
    
    .divider {
        display: none;
    }
}

/* Mobile Styles */
@media (max-width: 767.98px) {
    .hero-section {
        padding-top: 100px;
        min-height: 40vh;
        padding-bottom: 30px;
    }
    
    .hero-content {
        padding-top: 1rem;
        margin-top: 0.5rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .search-section {
        margin-top: -30px;
        padding-top: 50px;
        padding-bottom: 30px;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .search-bar-wrapper {
        max-width: 100%;
        margin: 0;
        padding: 0 10px;
    }
    
    .search-form-main {
        width: 100%;
        margin: 0;
    }
    
    .search-container {
        width: 100%;
        margin: 0;
    }
    
    .search-form-main .input-group {
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
        align-items: stretch;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }
    
    .search-input {
        padding: 12px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
        flex: 1;
        border: none;
        border-radius: 0;
        background: rgba(255, 255, 255, 0.98);
        min-width: 0; /* Allows flex shrinking */
    }
    
    .search-input:focus {
        outline: none;
        box-shadow: none;
        background: #ffffff;
    }
    
    .search-btn {
        padding: 12px 20px;
        border: none;
        border-radius: 0;
        background: var(--accent-color);
        color: var(--dark-color);
        font-weight: 600;
        font-size: 16px;
        flex-shrink: 0;
        min-width: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .search-btn i {
        font-size: 18px;
        line-height: 1;
    }
    
    .search-btn:hover,
    .search-btn:focus {
        background: #e0a800;
        transform: none; /* Remove transform on mobile to prevent layout shifts */
        outline: none;
    }
    
    /* Mobile Quick Links - Enhanced */
    .quick-access-section {
        padding: 1rem 0;
    }
    
    .quick-links {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 1rem;
        max-width: 100%;
    }
    
    .quick-link {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        justify-content: center;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    
    .quick-link:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(30, 77, 107, 0.25);
    }
    
    .divider {
        display: none;
    }
    
    .support-card {
        height: 200px;
    }
    
    .support-title {
        font-size: 0.8rem;
    }
    
    .support-overlay {
        padding: 0.5rem 0.75rem;
        min-height: 45px;
        max-height: 70px;
    }
    
    /* Mobile Content Sections */
    .content-sections {
        padding: 2rem 0;
    }
    
    .content-wrapper {
        margin: 0;
        border-radius: 0;
        min-height: auto;
    }
    
    .content-wrapper .p-4 {
        padding: 1.5rem !important;
        min-height: auto;
    }
    
    .events-list, .news-list {
        min-height: auto;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .content-wrapper .row.g-3 {
        min-height: auto;
        margin-bottom: 1rem !important;
    }
    
    /* Mobile Button Fix */
    .content-wrapper .text-center.mt-4 {
        padding: 1rem 0 0 !important;
        margin-left: -1.5rem !important;
        margin-right: -1.5rem !important;
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
    
    .content-wrapper .btn {
        min-width: 160px !important;
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
        display: block !important;
    }
    
    .section-title {
        font-size: 1.3rem;
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    body.homepage .event-item,
    body.homepage .news-item {
        padding: 1rem;
        margin-bottom: 1rem !important;
    }
    
    .book-image {
        height: 200px;
    }
    
    .contact-card,
    .help-card,
    .social-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .social-buttons {
        justify-content: center;
    }
}

/* Small Mobile Styles */
@media (max-width: 575.98px) {
    .hero-section {
        padding-top: 90px;
        min-height: 35vh;
    }
    
    .hero-content {
        padding-top: 0.5rem;
        margin-top: 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    /* Enhanced search section for extra small screens */
    .search-section {
        margin-top: -25px;
        padding-top: 45px;
        padding-bottom: 25px;
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .search-bar-wrapper {
        max-width: 100%;
        margin: 0;
        padding: 0 5px;
    }
    
    .search-form-main .input-group {
        border-radius: 10px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    }
    
    .search-input {
        padding: 10px 14px;
        font-size: 16px;
    }
    
    .search-btn {
        padding: 10px 16px;
        min-width: 50px;
    }
    
    .search-btn i {
        font-size: 16px;
    }
    
    /* Extra small mobile quick links */
    .quick-link {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
        max-width: 280px;
    }
    
    .support-card {
        height: 180px;
    }
    
    .support-title {
        font-size: 0.75rem;
    }
    
    .support-overlay {
        padding: 0.4rem 0.6rem;
        min-height: 40px;
        max-height: 60px;
    }
    
    .section-title {
        font-size: 1.2rem !important;
        margin-bottom: 1.2rem !important;
    }
    
    .event-title {
        font-size: 0.95rem !important;
    }
    
    .book-image {
        height: 180px;
    }
    
    .book-content {
        padding: 1rem;
    }
    
    .content-wrapper .btn {
        min-width: 140px !important;
        padding: 0.75rem 1.25rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Extra small news and events */
    .news-item {
        border-radius: 12px !important;
        min-height: 140px !important;
        margin-bottom: 1rem !important;
    }
    
    .news-item .news-content {
        padding: 1.2rem 1rem 1rem !important;
    }
    
    .news-item .news-title {
        font-size: 0.95rem !important;
        line-height: 1.3 !important;
    }
    
    .news-item .news-date {
        font-size: 0.75rem !important;
        padding: 0.4rem 0.8rem !important;
        border-radius: 15px !important;
        margin-top: 0.5rem !important;
    }
    
    .news-item .news-excerpt {
        font-size: 0.85rem !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, var(--light-color) 0%, var(--white-color) 100%);
}

.shadow-custom {
    box-shadow: var(--shadow-medium);
}

.border-radius-custom {
    border-radius: var(--border-radius-lg);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Custom Scrollbar for Better UX */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Focus Styles for Accessibility */
.btn:focus,
.form-control:focus,
.quick-link:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ============================================
   LAUNCH EFFECTS - SPECIAL ANIMATIONS
   ============================================ */

/* Welcome overlay animations */
.launch-celebration {
    animation: launchCelebration 2s ease-out;
}

@keyframes launchCelebration {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    25% {
        transform: scale(1.02);
        filter: brightness(1.1);
    }
    50% {
        transform: scale(1.05);
        filter: brightness(1.2);
    }
    75% {
        transform: scale(1.02);
        filter: brightness(1.1);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* Enhanced hero section for launch */
.hero-section.from-launch {
    animation: heroLaunchEntry 2s ease-out;
}

@keyframes heroLaunchEntry {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    50% {
        opacity: 0.7;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Floating particles background */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #f59e0b, #f97316);
    border-radius: 50%;
    animation: particleFloat 8s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-20px) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

/* Celebration mode for elements */
.celebrate-mode .quick-link {
    animation: quickLinkCelebrate 3s ease-in-out infinite;
}

@keyframes quickLinkCelebrate {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    50% {
        transform: scale(1.05) rotate(1deg);
        box-shadow: 0 8px 25px rgba(30, 77, 107, 0.2);
    }
}

.celebrate-mode .support-card {
    animation: supportCardDance 4s ease-in-out infinite;
}

@keyframes supportCardDance {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    25% {
        transform: translateY(-5px) rotate(1deg) scale(1.02);
    }
    75% {
        transform: translateY(-3px) rotate(-1deg) scale(1.01);
    }
}

/* Magic sparkle trail effect */
.magic-trail {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
}

.sparkle-trail {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #f59e0b, #fbbf24);
    border-radius: 50%;
    animation: sparkleTrail 1.5s ease-out forwards;
}

@keyframes sparkleTrail {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1) rotate(180deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

/* Enhanced button effects for launch mode */
.launch-mode .btn {
    position: relative;
    overflow: hidden;
}

.launch-mode .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.launch-mode .btn:hover::before {
    left: 100%;
}

/* Pulsing glow effect for important elements */
.launch-glow {
    animation: launchGlow 3s ease-in-out infinite;
}

@keyframes launchGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.6), 0 0 30px rgba(245, 158, 11, 0.3);
    }
}

/* Gradient text animation */
.gradient-text-animate {
    background: linear-gradient(45deg, #1e40af, #3b82f6, #10b981, #f59e0b);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientTextFlow 4s ease-in-out infinite;
}

@keyframes gradientTextFlow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Celebration confetti styles */
.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #f59e0b;
    animation: confettiDrop 4s linear infinite;
}

.confetti-piece:nth-child(2n) { background: #3b82f6; animation-delay: 0.5s; }
.confetti-piece:nth-child(3n) { background: #10b981; animation-delay: 1s; }
.confetti-piece:nth-child(4n) { background: #ef4444; animation-delay: 1.5s; }
.confetti-piece:nth-child(5n) { background: #8b5cf6; animation-delay: 2s; }

@keyframes confettiDrop {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Welcome message animation */
.welcome-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    z-index: 9999;
    animation: welcomeSlideIn 1s ease-out, welcomeFadeOut 1s ease-in 4s forwards;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

@keyframes welcomeSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes welcomeFadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Print Styles */
@media print {
    .hero-section,
    .search-section,
    .bottom-contact-section {
        display: none;
    }
    
    .content-sections {
        background: white;
    }
    
    .content-wrapper {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
