/* Modern Bootstrap 5 Custom Styles for Musoma COHAS Digital Library */
@import url('mucohas-brand.css');

:root {
    --primary-color: var(--mucohas-blue);
    --secondary-color: var(--mucohas-green);
    --success-color: var(--mucohas-green);
    --info-color: var(--mucohas-blue-light);
    --warning-color: var(--mucohas-yellow);
    --danger-color: #dc3545;
    --dark-color: var(--mucohas-black);
    --light-color: var(--mucohas-gray);
    --bs-primary: var(--mucohas-blue);
    --bs-primary-rgb: 20, 84, 168;
}

/* Bootstrap primary color override */
.bg-primary, .btn-primary, .text-primary, .border-primary {
    --bs-primary: var(--mucohas-blue);
    --bs-primary-rgb: 20, 84, 168;
}
.bg-primary {
    background-color: var(--mucohas-blue) !important;
    color: #fff !important;
}
.btn-primary {
    background-color: var(--mucohas-blue) !important;
    border-color: var(--mucohas-blue) !important;
    color: #fff !important;
}
.btn-primary:hover {
    background-color: var(--mucohas-blue-light) !important;
    border-color: var(--mucohas-blue-light) !important;
    color: #fff !important;
}
.text-primary {
    color: var(--mucohas-blue) !important;
}
.border-primary {
    border-color: var(--mucohas-blue) !important;
}
.btn-outline-primary {
    color: var(--mucohas-blue) !important;
    border-color: var(--mucohas-blue) !important;
    background-color: transparent !important;
}
.btn-outline-primary:hover {
    background-color: var(--mucohas-blue) !important;
    border-color: var(--mucohas-blue) !important;
    color: #fff !important;
}

/* Global Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--mucohas-black);
    background-color: var(--mucohas-gray);
}

/* Ensure white text on dark backgrounds */
section[style*="#0f172a"],
section[style*="background: #0f172a"],
.bg-gradient-primary,
.bg-primary,
[style*="background: #0f172a"] h1,
[style*="background: #0f172a"] h2,
[style*="background: #0f172a"] h3,
[style*="background: #0f172a"] h4,
[style*="background: #0f172a"] h5,
[style*="background: #0f172a"] h6,
[style*="background: #0f172a"] p,
[style*="background: #0f172a"] .lead,
[style*="background: #0f172a"] .display-1,
[style*="background: #0f172a"] .display-2,
[style*="background: #0f172a"] .display-3,
[style*="background: #0f172a"] .display-4,
[style*="background: #0f172a"] .display-5,
[style*="background: #0f172a"] .display-6 {
    color: #fff !important;
}

/* Hero Section */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section h1,
.hero-section h2,
.hero-section h3,
.hero-section h4,
.hero-section h5,
.hero-section h6,
.hero-section p,
.hero-section .lead,
.hero-section .display-1,
.hero-section .display-2,
.hero-section .display-3,
.hero-section .display-4,
.hero-section .display-5,
.hero-section .display-6 {
    color: #fff !important;
}

.hero-overlay {
    z-index: 1;
}

.hero-section .container {
    z-index: 2;
}

.min-vh-50 {
    min-height: 50vh;
}

/* Card Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Icon Box */
.icon-box {
    transition: transform 0.3s ease;
}

.hover-lift:hover .icon-box {
    transform: scale(1.1);
}

/* Divider */
.divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--mucohas-blue), var(--mucohas-green), var(--mucohas-yellow));
    border-radius: 2px;
}

/* Solid Backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--mucohas-blue-dark) 0%, var(--mucohas-blue) 60%, var(--mucohas-blue-light) 100%);
    color: #fff;
}

.bg-gradient-primary h1,
.bg-gradient-primary h2,
.bg-gradient-primary h3,
.bg-gradient-primary h4,
.bg-gradient-primary h5,
.bg-gradient-primary h6,
.bg-gradient-primary p,
.bg-gradient-primary .lead,
.bg-gradient-primary .display-1,
.bg-gradient-primary .display-2,
.bg-gradient-primary .display-3,
.bg-gradient-primary .display-4,
.bg-gradient-primary .display-5,
.bg-gradient-primary .display-6 {
    color: #fff !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--mucohas-green-dark) 0%, var(--mucohas-green) 100%);
    color: #fff;
}

.bg-gradient-success h1,
.bg-gradient-success h2,
.bg-gradient-success h3,
.bg-gradient-success h4,
.bg-gradient-success h5,
.bg-gradient-success h6,
.bg-gradient-success p,
.bg-gradient-success .lead {
    color: #fff !important;
}

.bg-gradient-info {
    background: linear-gradient(135deg, var(--mucohas-blue) 0%, var(--mucohas-blue-light) 100%);
    color: #fff;
}

.bg-gradient-info h1,
.bg-gradient-info h2,
.bg-gradient-info h3,
.bg-gradient-info h4,
.bg-gradient-info h5,
.bg-gradient-info h6,
.bg-gradient-info p,
.bg-gradient-info .lead {
    color: #fff !important;
}

/* Modern Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.625rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 0.5rem 1.25rem;
    font-size: var(--mucohas-fs-label, 1rem);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: var(--mucohas-blue);
    border: none;
    color: #fff;
}

.btn-primary:hover {
    background: var(--mucohas-blue-light);
    color: #fff;
}

/* Modern Cards */
.card {
    border-radius: 12px;
    border: none;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card-header {
    background: var(--mucohas-blue);
    color: #fff;
    border: none;
    padding: 1.25rem;
    font-weight: 600;
}

/* ----- Modern Header / Navbar ----- */
.navbar-spacer {
    height: 76px;
}

.navbar-modern {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: var(--mucohas-blue-dark) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    padding: 0.5rem 0;
    border-bottom: 3px solid var(--mucohas-yellow);
}

.navbar-modern .navbar-brand {
    font-size: var(--mucohas-fs-h4, 1.083rem);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    color: #fff !important;
    transition: opacity 0.2s ease;
}

.navbar-modern .navbar-brand:hover {
    opacity: 0.92;
}

.navbar-modern .navbar-brand-text {
    letter-spacing: -0.02em;
}

.navbar-modern .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    margin: 0 0.15rem;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.25s ease;
}

.navbar-modern .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff !important;
}

.navbar-modern .nav-link.active {
    background-color: rgba(244, 196, 48, 0.25);
    color: #fff !important;
}

.navbar-modern .dropdown-menu {
    border: none;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.navbar-modern .dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 1rem;
}

.navbar-modern .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.4);
    padding: 0.4rem 0.6rem;
}

.navbar-modern .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.3);
}

/* Legacy navbar (when not using .navbar-modern) */
.navbar {
    backdrop-filter: blur(10px);
    background: var(--mucohas-blue-dark) !important;
}

.navbar-brand {
    font-size: var(--mucohas-fs-h4, 1.083rem);
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 0 0.25rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Dropdown Menu */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.dropdown-item {
    border-radius: 6px;
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

/* Form Controls */
.form-control {
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--mucohas-blue);
    box-shadow: 0 0 0 0.2rem rgba(20, 84, 168, 0.25);
    color: var(--mucohas-black);
}

.input-group-lg .form-control {
    padding: 0.5rem 0.75rem;
    font-size: var(--mucohas-fs-body, 1rem);
}

/* Nav Pills */
.nav-pills .nav-link {
    border-radius: 8px;
    color: #6b7280;
    background-color: #f3f4f6;
    margin: 0 0.25rem;
}

.nav-pills .nav-link.active {
    background: var(--mucohas-blue);
    color: #fff;
}

/* Badge Styles */
.badge {
    padding: 0.5em 0.75em;
    border-radius: 6px;
    font-weight: 500;
}

/* Table Styles */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead {
    background: var(--mucohas-blue);
    color: #fff;
}

.table thead th {
    border: none;
    font-weight: 600;
    padding: 1rem;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f9fafb;
    transform: scale(1.01);
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.5rem;
}

/* ----- Modern Footer ----- */
.footer-modern {
    position: relative;
    background: var(--mucohas-blue-dark);
    color: rgba(255, 255, 255, 0.95);
    padding: 3.5rem 0 0;
    margin-top: 4rem;
    font-size: var(--mucohas-fs-body, 1rem);
}

.footer-wave {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--mucohas-blue), var(--mucohas-green), var(--mucohas-yellow));
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 2.5rem;
    padding-bottom: 2.5rem;
}

.footer-brand {
    max-width: 320px;
}

.footer-logo {
    display: block;
    filter: brightness(1.05);
}

.footer-tagline {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

.footer-social-label {
    display: block;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.75rem;
    font-size: var(--mucohas-fs-small, 0.917rem);
}

.footer-social-links {
    display: flex;
    gap: 0.75rem;
}

.footer-social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.25s ease;
}

.footer-social-links a:hover {
    background: var(--mucohas-green);
    color: #fff;
    transform: translateY(-2px);
}

.footer-heading {
    font-size: var(--mucohas-fs-label, 1rem);
    font-weight: 600;
    color: #fff;
    margin-bottom: 1.25rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-list li {
    margin-bottom: 0.65rem;
}

.footer-list li i {
    margin-right: 0.5rem;
    opacity: 0.8;
}

.footer-list a,
.footer-list li {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-list a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.25rem 0;
}

.footer-copy {
    margin: 0;
    font-size: var(--mucohas-fs-small, 0.917rem);
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
}

.footer-copy a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-copy a:hover {
    color: #fff;
}

.footer-back-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--mucohas-blue);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: all 0.25s ease;
    z-index: 900;
}

.footer-back-top:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(20, 84, 168, 0.5);
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .footer-brand {
        max-width: none;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .footer-modern {
        padding-top: 2.5rem;
    }
}

/* Legacy footer (when not using .footer-modern) */
footer {
    background: var(--mucohas-blue-dark);
    color: #fff;
    padding: 3rem 0 1.5rem;
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: white;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .display-3 {
        font-size: var(--mucohas-fs-h1, 1.417rem);
    }
    
    .display-5 {
        font-size: var(--mucohas-fs-h2, 1.25rem);
    }
    
    .hero-section {
        min-height: 500px;
    }
}

/* Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--mucohas-blue);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--mucohas-blue-light);
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
}
