/**
 * MSN Website Custom Theme CSS
 * File: assets/css/styles.css
 * Purpose: Custom branding and theme overrides for Bootstrap 5
 * Author: Materials Science and Technology Society of Nigeria
 * Version: 1.0.0
 * Last Updated: 2025
 * 
 * This file contains minimal customizations to complement Bootstrap 5
 * All major styling is handled by Bootstrap's utility classes
 */

/* ==================== CSS CUSTOM PROPERTIES ==================== */
:root {
    /* MSN Brand Colors */
    --msn-primary: #1e40af;
    --msn-secondary: #3b82f6;
    --msn-accent: #f59e0b;
    --msn-success: #10b981;
    --msn-warning: #f59e0b;
    --msn-danger: #ef4444;
    --msn-info: #06b6d4;
    --msn-dark: #1f2937;
    --msn-light: #f8fafc;
    
    /* Academic Typography */
    --msn-font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
    --msn-font-serif: 'IBM Plex Serif', Georgia, serif;
    
    /* Shadows */
    --msn-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --msn-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --msn-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --msn-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --msn-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --msn-transition: all 0.15s ease-in-out;
    --msn-transition-slow: all 0.3s ease-in-out;
}

/* ==================== GLOBAL OVERRIDES ==================== */
body {
    font-family: var(--msn-font-family);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--msn-font-serif);
    font-weight: 600;
    line-height: 1.2;
}

/* ==================== BOOTSTRAP CUSTOMIZATIONS ==================== */
/* Override Bootstrap's primary color */
.btn-primary {
    --bs-btn-bg: var(--msn-primary);
    --bs-btn-border-color: var(--msn-primary);
    --bs-btn-hover-bg: #1e3a8a;
    --bs-btn-hover-border-color: #1e3a8a;
    --bs-btn-active-bg: #1e3a8a;
    --bs-btn-active-border-color: #1e3a8a;
}

.btn-warning {
    --bs-btn-bg: var(--msn-accent);
    --bs-btn-border-color: var(--msn-accent);
    --bs-btn-color: #000;
    --bs-btn-hover-bg: #d97706;
    --bs-btn-hover-border-color: #d97706;
    --bs-btn-active-bg: #d97706;
    --bs-btn-active-border-color: #d97706;
}

.bg-primary {
    background-color: var(--msn-primary) !important;
}

.text-primary {
    color: var(--msn-primary) !important;
}

.border-primary {
    border-color: var(--msn-primary) !important;
}

/* ==================== NAVIGATION ENHANCEMENTS ==================== */
.navbar-brand {
    font-family: var(--msn-font-serif);
    font-weight: 700;
    transition: var(--msn-transition);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: var(--msn-transition);
    position: relative;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--msn-primary);
    transition: var(--msn-transition);
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 80%;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--msn-shadow-lg);
    border-radius: 0.75rem;
}

.dropdown-item {
    transition: var(--msn-transition);
    border-radius: 0.5rem;
    margin: 0.125rem 0.5rem;
}

.dropdown-item:hover {
    background-color: rgba(30, 64, 175, 0.1);
    color: var(--msn-primary);
}

/* ==================== HEADER SCROLL EFFECTS ==================== */
.sticky-top {
    transition: var(--msn-transition-slow);
}

.sticky-top.scrolled {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--msn-shadow-md);
}

/* ==================== HERO SECTION ENHANCEMENTS ==================== */
.bg-primary {
    background: linear-gradient(135deg, var(--msn-primary) 0%, var(--msn-secondary) 100%) !important;
}

/* ==================== CARD ENHANCEMENTS ==================== */
.card {
    border: none;
    box-shadow: var(--msn-shadow);
    transition: var(--msn-transition-slow);
    border-radius: 1rem;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--msn-shadow-lg);
}

.card-header {
    border-bottom: none;
    border-radius: 1rem 1rem 0 0 !important;
}

.card-footer {
    border-top: none;
    border-radius: 0 0 1rem 1rem !important;
}

/* ==================== BUTTON ENHANCEMENTS ==================== */
.btn {
    font-weight: 500;
    border-radius: 0.75rem;
    transition: var(--msn-transition);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-lg {
    border-radius: 1rem;
}

.btn-sm {
    border-radius: 0.5rem;
}

/* Button loading state */
.btn .spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* ==================== FORM ENHANCEMENTS ==================== */
.form-control {
    border-radius: 0.75rem;
    border: 2px solid #e5e7eb;
    transition: var(--msn-transition);
    font-weight: 400;
}

.form-control:focus {
    border-color: var(--msn-primary);
    box-shadow: 0 0 0 0.2rem rgba(30, 64, 175, 0.1);
}

.form-control.is-valid {
    border-color: var(--msn-success);
    background-image: none;
}

.form-control.is-invalid {
    border-color: var(--msn-danger);
    background-image: none;
}

.form-select {
    border-radius: 0.75rem;
    border: 2px solid #e5e7eb;
}

.form-select:focus {
    border-color: var(--msn-primary);
    box-shadow: 0 0 0 0.2rem rgba(30, 64, 175, 0.1);
}

/* ==================== BADGE ENHANCEMENTS ==================== */
.badge {
    font-weight: 500;
    border-radius: 2rem;
}

/* ==================== ALERT ENHANCEMENTS ==================== */
.alert {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--msn-shadow-sm);
}

.alert-primary {
    background-color: rgba(30, 64, 175, 0.1);
    color: var(--msn-primary);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--msn-success);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--msn-accent);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--msn-danger);
}

/* ==================== MODAL ENHANCEMENTS ==================== */
.modal-content {
    border: none;
    border-radius: 1.5rem;
    box-shadow: var(--msn-shadow-xl);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 1.5rem 1.5rem 0 0;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 0 0 1.5rem 1.5rem;
}

/* ==================== PROGRESS BAR ENHANCEMENTS ==================== */
.progress {
    border-radius: 2rem;
    background-color: rgba(30, 64, 175, 0.1);
}

.progress-bar {
    border-radius: 2rem;
    background: linear-gradient(90deg, var(--msn-primary), var(--msn-secondary));
}

/* ==================== BACK TO TOP BUTTON ==================== */
#backToTop {
    border-radius: 50%;
    box-shadow: var(--msn-shadow-lg);
    transition: var(--msn-transition-slow);
    border: none;
}

#backToTop:hover {
    transform: translateY(-4px);
    box-shadow: var(--msn-shadow-xl);
}

/* ==================== ACCESSIBILITY ENHANCEMENTS ==================== */
/* Skip link */
.visually-hidden-focusable:focus {
    z-index: 9999;
    background-color: var(--msn-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
}

/* Focus indicators */
*:focus-visible {
    outline: 2px solid var(--msn-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--msn-dark);
    }
    
    .btn {
        border-width: 2px;
    }
    
    .form-control {
        border-width: 3px;
    }
}

/* ==================== DARK MODE PREPARATION ==================== */
@media (prefers-color-scheme: dark) {
    /* Dark mode variables would go here for future implementation */
    /* Currently using Bootstrap's default light theme */
}

/* ==================== REDUCED MOTION ==================== */
@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;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .navbar,
    .btn,
    #backToTop,
    .modal,
    .alert,
    [data-bs-toggle],
    .d-print-none {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #000;
        page-break-after: avoid;
    }
    
    p, li {
        orphans: 3;
        widows: 3;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* ==================== UTILITY CLASSES ==================== */
/* Custom MSN utilities to complement Bootstrap */
.shadow-msn {
    box-shadow: var(--msn-shadow) !important;
}

.shadow-msn-lg {
    box-shadow: var(--msn-shadow-lg) !important;
}

.transition-msn {
    transition: var(--msn-transition) !important;
}

.transition-msn-slow {
    transition: var(--msn-transition-slow) !important;
}

.font-serif {
    font-family: var(--msn-font-serif) !important;
}

.font-sans {
    font-family: var(--msn-font-family) !important;
}

/* Gradient text utility */
.text-gradient {
    background: linear-gradient(135deg, var(--msn-primary), var(--msn-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive text utilities */
@media (max-width: 576px) {
    .display-1 { font-size: 2.5rem; }
    .display-2 { font-size: 2rem; }
    .display-3 { font-size: 1.75rem; }
    .display-4 { font-size: 1.5rem; }
}

/* ==================== COMPONENT-SPECIFIC STYLES ==================== */
/* Navbar toggler animation */
.navbar-toggler {
    border: none;
    padding: 0.25rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Validation messages */
.validation-message {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Hero section animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.hero-float {
    animation: float 3s ease-in-out infinite;
}

/* Card hover effects */
.card-hover {
    transition: var(--msn-transition-slow);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: var(--msn-shadow-xl);
}

/* Social media icons */
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    transition: var(--msn-transition);
    text-decoration: none;
}

.social-link:hover {
    transform: translateY(-2px);
}

/* ==================== MOBILE OPTIMIZATIONS ==================== */
@media (max-width: 768px) {
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .modal-dialog {
        margin: 1rem;
    }
    
    .hero-float {
        animation: none;
    }
}

/* ==================== PERFORMANCE OPTIMIZATIONS ==================== */
/* GPU acceleration for animations */
.card,
.btn,
#backToTop {
    will-change: transform;
}

/* Optimize font loading */
.font-display-swap {
    font-display: swap;
}

/* ==================== GLOBAL OVERRIDES ==================== */
body {
    font-family: var(--msn-font-family);
    line-height: 1.6;
}

/* ==================== HERO CAROUSEL FIXES ==================== */
.hero-carousel-container {
    height: 85vh; /* Set to 85vh for optimal visual impact */
    min-height: 600px; /* Minimum height for smaller screens */
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--msn-shadow-lg);
}

.carousel-inner {
    height: 100%;
}

.carousel-item {
    height: 100%;
}

.hero-slide {
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* Carousel controls styling */
.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    opacity: 0.8;
    transition: var(--msn-transition);
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

.carousel-indicators {
    margin-bottom: 2rem;
}

.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 4px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid white;
}

.carousel-indicators .active {
    background-color: var(--msn-accent);
}

/* Responsive carousel adjustments */
@media (max-width: 992px) {
    .hero-carousel-container {
        height: 75vh;
        min-height: 550px;
    }
}

@media (max-width: 768px) {
    .hero-carousel-container {
        height: 65vh;
        min-height: 450px;
        border-radius: 0.75rem;
    }
    
    .hero-content .display-4 {
        font-size: 2.5rem;
    }
    
    .carousel-control-prev,
    .carousel-control-next {
        width: 8%;
    }
}

@media (max-width: 576px) {
    .hero-carousel-container {
        height: 55vh;
        min-height: 400px;
        border-radius: 0.5rem;
    }
    
    .hero-content .display-4 {
        font-size: 2rem;
    }
    
    .hero-content .lead {
        font-size: 1rem;
    }
    
    .carousel-indicators {
        margin-bottom: 1rem;
    }
}

/* ==================== FOOTER ENHANCEMENTS ==================== */
footer.bg-dark {
    background-color: #1f2937 !important;
}

footer.bg-dark h3,
footer.bg-dark h4,
footer.bg-dark h5,
footer.bg-dark h6 {
    color: #ffffff !important;
}

footer.bg-dark p {
    color: #e5e7eb !important;
}

footer.bg-dark .text-muted {
    color: #9ca3af !important;
}

footer.bg-dark .text-white {
    color: #ffffff !important;
}

footer.bg-dark .text-warning {
    color: var(--msn-accent) !important;
}

footer.bg-dark a {
    color: #d1d5db !important;
    text-decoration: none;
    transition: var(--msn-transition);
}

footer.bg-dark a:hover {
    color: #ffffff !important;
    text-decoration: underline;
}

footer.bg-dark ul li a {
    color: #d1d5db !important;
}

footer.bg-dark ul li a:hover {
    color: #ffffff !important;
    transform: translateX(5px);
}

footer.bg-dark .small {
    color: #e5e7eb !important;
}