/* 
 * ITB Ichsan Boalemo - Main Stylesheet
 * Based on Design System v1.0
 */

/* =========================================
   1. IMPORTS & VARIABLES
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Open+Sans:wght@400;600&display=swap');

:root {
    /* Brand Colors */
    --primary-color: #008C45;       /* Ichsan Green */
    --primary-dark: #006833;        /* Darker Green for Hover */
    --secondary-color: #F9C000;     /* Ichsan Gold */
    --accent-blue: #00AEEF;         /* Tech Blue */
    --accent-red: #EE3224;          /* Campus Red */
    
    /* Neutrals */
    --text-dark: #2D3436;
    --text-muted: #636e72;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    
    /* UI Elements */
    --border-radius: 8px;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    --box-shadow-hover: 0 8px 25px rgba(0, 140, 69, 0.15);
    
    /* Bootstrap Overrides (Mapped) */
    --bs-primary: var(--primary-color);
    --bs-primary-rgb: 0, 140, 69;
    --bs-body-font-family: 'Open Sans', sans-serif;
}

/* =========================================
   2. GLOBAL STYLES & TYPOGRAPHY
   ========================================= */
body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--text-dark);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* =========================================
   3. BOOTSTRAP OVERRIDES
   ========================================= */
/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    padding: 10px 25px;
    border-radius: 5px;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-light:hover {
    color: var(--primary-color);
    background-color: #fff;
}

/* Text Colors */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Shadows */
.shadow-sm {
    box-shadow: var(--box-shadow) !important;
}

.shadow {
    box-shadow: var(--box-shadow-hover) !important;
}

/* =========================================
   4. COMPONENT STYLES
   ========================================= */

/* Navbar */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding-top: 15px;
    padding-bottom: 15px;
}

/* Navbar Toggler Customization */
.navbar-toggler {
    transition: transform 0.3s ease;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

.navbar-toggler[aria-expanded="true"] {
    transform: rotate(90deg);
}

.navbar-brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

/* Brand color based on navbar theme */
.navbar-light .navbar-brand {
    color: var(--primary-color) !important;
}

.navbar-dark .navbar-brand {
    color: white !important;
}

.nav-link {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    margin: 0 10px;
    position: relative;
}

/* Nav Link colors based on theme */
.navbar-light .nav-link {
    color: var(--text-dark) !important;
}

.navbar-light .nav-link.btn {
    color: white !important;
}

.navbar-dark .nav-link {
    color: rgba(255,255,255,0.85) !important;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color) !important;
}

.navbar-dark .nav-link:hover, .navbar-dark .nav-link.active {
    color: white !important;
}

/* Active Indicator for Nav Items */
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--secondary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 80%;
}

/* Hero Section */
.hero-section {
    /* Using a gradient overlay with brand colors */
    background: linear-gradient(135deg, rgba(0, 60, 25, 0.85) 0%, rgba(0, 40, 15, 0.75) 100%), url('img/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll; /* Changed from fixed for better mobile performance */
    color: white;
    padding: 120px 0; /* Reduced slightly */
    text-align: center;
    position: relative;
}

/* Ensure overlay covers everything if needed, but background-blend works well */

/* Campus Logo (About Page) */
.campus-logo {
    max-width: 240px;
    width: 100%;
    height: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .campus-logo {
        max-width: 180px;
    }
}

.hero-section h1 {
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Section Styling */
section {
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.25rem;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
    background: white;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Gallery Carousel */
#galleryCarousel .gallery-carousel-figure img {
    height: 500px;
    object-fit: cover;
}

#galleryCarousel .gallery-carousel-caption {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-top: 0;
    padding: 14px 16px;
    text-align: left;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#galleryCarousel .gallery-carousel-title {
    color: var(--text-dark);
    font-weight: 700;
    font-size: clamp(1.05rem, 1.6vw, 1.35rem);
    line-height: 1.2;
    margin: 0;
}

#galleryCarousel .gallery-carousel-desc {
    color: var(--text-muted);
    font-size: clamp(0.9rem, 1.25vw, 1rem);
    line-height: 1.4;
}

@media (max-width: 576px) {
    #galleryCarousel .gallery-carousel-figure img {
        height: 340px;
    }

    #galleryCarousel .gallery-carousel-caption {
        padding: 12px 12px;
        min-height: 64px;
    }

    #galleryCarousel .gallery-carousel-desc {
        font-size: 0.92rem;
    }
}

/* Feature Icon Cards */
.card .fas, .card .far {
    transition: transform 0.3s ease;
}

.card:hover .fas, .card:hover .far {
    transform: scale(1.1);
}

/* Footer */
footer {
    background-color: #1a1d20; /* Darker than standard bootstrap dark */
    color: #e0e0e0;
    padding-top: 40px;
    padding-bottom: 20px;
    border-top: 5px solid var(--primary-color);
}

footer h5 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.1rem;
    position: relative;
    padding-left: 15px;
}

footer h5::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    height: 15px;
    width: 4px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

footer a {
    color: #a0a0a0;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-block;
    margin-bottom: 2px;
}

footer a:hover {
    color: var(--secondary-color);
    transform: translateX(5px);
}

footer .border-secondary {
    border-color: rgba(255,255,255,0.1) !important;
}

footer .row {
    row-gap: 10px;
}

footer p {
    margin-bottom: 8px;
}

footer ul {
    margin-bottom: 0;
}

footer ul li {
    margin-bottom: 6px;
}

footer hr {
    margin: 16px 0;
    opacity: 0.25;
}

footer .mb-4 {
    margin-bottom: 1rem !important;
}

footer .mb-3 {
    margin-bottom: 0.75rem !important;
}

@media (min-width: 768px) {
    footer .col-md-4:nth-child(2) ul.list-unstyled {
        columns: 2;
        column-gap: 24px;
    }
}

/* =========================================
   5. UTILITIES & RESPONSIVE
   ========================================= */
.text-justify {
    text-align: justify;
}

.bg-light {
    background-color: #f8f9fa !important;
}

/* Badge Customization */
.badge {
    font-weight: 500;
    padding: 0.5em 0.8em;
}

.bg-warning {
    background-color: var(--secondary-color) !important;
    color: #212529;
}

/* Form Controls */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(0, 140, 69, 0.25);
}

/* Login Card Specific */
.login-card {
    border-top: 5px solid var(--primary-color);
}

/* Media Queries */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: white;
        padding: 1rem;
        border-radius: var(--border-radius);
        margin-top: 1rem;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }
    
    .nav-item {
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        padding: 12px 0 !important;
        margin: 0 !important;
    }

    .nav-link::after {
        display: none; /* Disable underline effect on mobile */
    }

    .nav-link.btn {
        margin-top: 1rem;
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 80px 0;
    }
    
    .hero-section h1 {
        font-size: 2.2rem;
        line-height: 1.3;
    }
    
    .section-title {
        font-size: 1.75rem;
    }

    .navbar-brand {
        font-size: 1.1rem;
        max-width: 75%; /* Prevent overlapping with toggler */
        line-height: 1.2;
    }

    .navbar-brand img {
        height: 40px;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1rem; /* Slightly smaller font */
        margin-right: 0;
    }
    
    .navbar-brand img {
        height: 35px; /* Smaller logo */
    }
    
    .navbar-brand span.brand-text {
        font-size: 0.9rem; /* Smaller font for mobile */
        line-height: 1.1;
        display: inline-block;
        max-width: 200px; /* Ensure it doesn't push toggler too far if very small screen */
    }

    .hero-section {
        padding: 60px 0 80px 0; /* Extra bottom padding for overlap if needed */
        text-align: center;
    }

    .hero-section h1 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    .hero-section .lead {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }

    /* Stack buttons with gap */
    .hero-section .d-flex {
        flex-direction: column;
        gap: 10px;
    }

    .hero-section .btn {
        width: 100%;
        margin: 0; /* Reset margins in favor of gap */
        min-height: 48px; /* Touch target size */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }

    .card {
        margin-bottom: 15px;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    /* Footer adjustments */
    footer {
        text-align: center;
    }
    
    footer h5::before {
        left: 50%;
        transform: translateX(-50%);
        top: -10px;
        width: 30px;
        height: 4px;
    }
    
    footer h5 {
        padding-left: 0;
        margin-top: 1.5rem;
    }
}
