/*
 * CSS Stylesheet: MI Ma'arif Aditirta
 * Khas Lembaga Pendidikan Ma'arif NU (Hijau Nuansa Islami & Gold)
 */

:root {
    --primary: #0d6838;
    --primary-dark: #074e28;
    --primary-light: #15803d;
    --primary-subtle: #ecfdf5;
    --secondary: #d97706;
    --secondary-dark: #b45309;
    --secondary-light: #fef3c7;
    --accent: #0284c7;
    --dark: #0f172a;
    --dark-muted: #475569;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font-main);
    color: #334155;
    background-color: var(--light-bg);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Topbar */
.topbar {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    font-size: 0.875rem;
    color: #e2e8f0;
}
.topbar a {
    color: #e2e8f0;
    text-decoration: none;
    transition: color 0.2s;
}
.topbar a:hover {
    color: #fef08a;
}

/* Navbar */
.navbar-custom {
    background-color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
.navbar-custom.scrolled {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}
.navbar-brand .logo-img {
    height: 48px;
    width: auto;
}
.navbar-brand-text {
    line-height: 1.2;
}
.navbar-brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}
.navbar-brand-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nav-link-custom {
    color: #334155 !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0.9rem !important;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.nav-link-custom:hover, 
.nav-link-custom.active {
    color: var(--primary) !important;
    background-color: var(--primary-subtle);
}

/* Dropdown styling & desktop hover */
@media (min-width: 992px) {
    .navbar-nav .dropdown:hover > .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
    .navbar-nav .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
        min-width: 260px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08) !important;
        border: 1px solid rgba(13, 104, 56, 0.08) !important;
        padding: 8px;
    }
    .navbar-nav .dropdown-item {
        border-radius: 8px;
        padding: 9px 14px;
        font-size: 0.92rem;
        transition: all 0.2s ease;
    }
    .navbar-nav .dropdown-item:hover {
        background-color: var(--primary-subtle);
        color: var(--primary);
        transform: translateX(4px);
    }
}

/* Hero Section */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, #074e28 0%, #0d6838 50%, #047857 100%);
    color: #ffffff;
    padding: 90px 0 120px 0;
    overflow: hidden;
}
.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    opacity: 0.8;
}
.hero-badge {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fef08a;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.875rem;
}
.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
}
.hero-desc {
    font-size: 1.15rem;
    color: #e2e8f0;
    line-height: 1.7;
}

/* Wave Divider */
.custom-shape-divider-bottom {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}
.custom-shape-divider-bottom svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 50px;
}
.custom-shape-divider-bottom .shape-fill {
    fill: var(--light-bg);
}

/* Quick Info Badges Bar */
.quick-info-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    margin-top: -50px;
    position: relative;
    z-index: 10;
}

/* Section Header */
.section-badge {
    color: var(--primary);
    background-color: var(--primary-subtle);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 30px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}
.section-title {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.25;
}
.section-subtitle {
    color: var(--dark-muted);
    font-size: 1.05rem;
}

/* Cards & Components */
.feature-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 28px;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    position: relative;
    overflow: hidden;
}
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s;
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px rgba(13, 104, 56, 0.08);
    border-color: rgba(13, 104, 56, 0.2);
}
.feature-card:hover::before {
    opacity: 1;
}

.feature-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 20px;
}
.icon-primary {
    background: var(--primary-subtle);
    color: var(--primary);
}
.icon-secondary {
    background: var(--secondary-light);
    color: var(--secondary-dark);
}
.icon-accent {
    background: #e0f2fe;
    color: #0284c7;
}

/* Stats Counter Box */
.stat-box {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    border: 1px solid #bbf7d0;
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.stat-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark-muted);
    margin-top: 8px;
}

/* Teacher / Staff Card */
.teacher-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}
.teacher-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}
.teacher-avatar-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 200px;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.teacher-avatar-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.teacher-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(13, 104, 56, 0.9);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* Prestasi Table & Badges */
.table-prestasi th {
    background-color: #f1f5f9;
    color: var(--dark);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #cbd5e1;
}
.badge-juara-1 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-weight: 700;
}
.badge-juara-2 {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: #fff;
    font-weight: 700;
}
.badge-juara-3 {
    background: linear-gradient(135deg, #b45309, #78350f);
    color: #fff;
    font-weight: 700;
}

/* SWOT Box Styling */
.swot-card {
    border-radius: 16px;
    padding: 24px;
    height: 100%;
    border-left: 5px solid;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}
.swot-strength {
    border-left-color: #10b981;
    background: linear-gradient(to bottom right, #ffffff, #f0fdf4);
}
.swot-weakness {
    border-left-color: #f59e0b;
    background: linear-gradient(to bottom right, #ffffff, #fffbeb);
}
.swot-opportunity {
    border-left-color: #3b82f6;
    background: linear-gradient(to bottom right, #ffffff, #eff6ff);
}
.swot-threat {
    border-left-color: #ef4444;
    background: linear-gradient(to bottom right, #ffffff, #fef2f2);
}

/* News / Article Card */
.article-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}
.article-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(13, 104, 56, 0.12);
    border-color: rgba(13, 104, 56, 0.25);
}
.article-img-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
    background: #f1f5f9;
}
.article-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.article-card:hover .article-img-wrap img {
    transform: scale(1.06);
}
.article-card .card-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.9em;
}
.article-card .card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.65;
    color: #64748b;
}

/* Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 15px rgba(13, 104, 56, 0.25);
    transition: all 0.25s ease;
}
.btn-primary-custom:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #053b1e 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13, 104, 56, 0.35);
}

.btn-secondary-custom {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: #ffffff;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.25);
    transition: all 0.25s ease;
}
.btn-secondary-custom:hover {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, #92400e 100%);
    color: #ffffff;
    transform: translateY(-2px);
}

.btn-outline-primary-custom {
    color: var(--primary);
    border: 2px solid var(--primary);
    font-weight: 700;
    padding: 8px 22px;
    border-radius: 10px;
    background: transparent;
    transition: all 0.25s ease;
}
.btn-outline-primary-custom:hover {
    background-color: var(--primary);
    color: #ffffff;
    transform: translateY(-2px);
}

/* Footer */
.footer-main {
    background: linear-gradient(180deg, #09381e 0%, #052112 100%);
    color: #94a3b8;
    padding: 70px 0 30px 0;
    font-size: 0.95rem;
}
.footer-main h5 {
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}
.footer-main h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--secondary);
    border-radius: 2px;
}
.footer-main a {
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s;
}
.footer-main a:hover {
    color: #fef08a;
    padding-left: 5px;
}
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 25px;
    margin-top: 50px;
    font-size: 0.875rem;
}

/* Global Responsive Enhancements */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}

/* Tablet & Mobile Adjustments (max-width: 991.98px) */
@media (max-width: 991.98px) {
    /* Navbar & Mobile Navigation */
    .navbar-brand {
        max-width: calc(100% - 64px);
    }
    .navbar-brand-title {
        font-size: 1.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .navbar-brand-subtitle {
        font-size: 0.68rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .navbar-brand img {
        width: 40px !important;
        height: 40px !important;
    }
    .navbar-collapse {
        background: #ffffff;
        padding: 16px;
        border-radius: 16px;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
        margin-top: 12px;
        border: 1px solid rgba(13, 104, 56, 0.12);
    }
    .navbar-nav .nav-link-custom {
        padding: 10px 14px !important;
        margin-bottom: 3px;
        display: flex;
        align-items: center;
        font-size: 0.95rem;
    }
    .navbar-nav .dropdown-menu {
        background: rgba(13, 104, 56, 0.04);
        border-radius: 12px;
        padding: 8px;
        border: 1px solid rgba(13, 104, 56, 0.08);
        margin-top: 4px;
        box-shadow: none;
    }
    .navbar-nav .dropdown-item {
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 0.9rem;
    }

    /* Hero Section */
    .hero-section {
        padding: 60px 0 95px 0;
        text-align: center;
    }
    .hero-badge {
        font-size: 0.8rem;
        padding: 5px 14px;
        margin-bottom: 14px;
    }
    .hero-title {
        font-size: 2.15rem;
        line-height: 1.25;
    }
    .hero-desc {
        font-size: 1.05rem;
        line-height: 1.65;
        margin-bottom: 24px;
    }
    .hero-section .d-flex.flex-wrap.gap-3 {
        justify-content: center;
    }

    /* Section Headings */
    .section-title {
        font-size: 1.75rem;
    }
    .quick-info-card {
        margin-top: 20px;
    }
}

/* Small Tablets & Mobile Landscape (max-width: 767.98px) */
@media (max-width: 767.98px) {
    /* Spacing */
    .container.py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    .card-body.p-4.p-md-5,
    .p-4.p-md-5 {
        padding: 1.25rem !important;
    }

    /* Quick Info Card Stacking */
    .quick-info-card {
        margin-top: 15px;
        padding: 16px;
    }
    .quick-info-card .border-end {
        border-right: none !important;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 14px;
    }
    .quick-info-card .row > div:last-child {
        border-bottom: none !important;
        padding-bottom: 0;
    }

    /* Stat Box & Counters */
    .stat-box {
        padding: 18px 12px;
    }
    .stat-number {
        font-size: 1.95rem;
    }
    .stat-label {
        font-size: 0.85rem;
        margin-top: 4px;
    }

    /* Cards */
    .feature-card {
        padding: 20px;
    }
    .swot-card {
        padding: 18px;
    }

    /* Google Maps Iframe */
    .card-body iframe[src*="google.com/maps"] {
        height: 270px !important;
    }

    /* Footer Mobile */
    .footer-main {
        padding: 45px 0 25px 0;
        text-align: center;
    }
    .footer-main h5::after {
        left: 50%;
        transform: translateX(-50%);
    }
    .footer-main .d-flex {
        justify-content: center;
    }
    .footer-bottom {
        margin-top: 35px;
        padding-top: 20px;
    }
}

/* Mobile Portrait / Small Devices (max-width: 575.98px) */
@media (max-width: 575.98px) {
    /* Brand Header on Ultra-Small Screens */
    .navbar-brand-title {
        font-size: 0.98rem;
    }
    .navbar-brand-subtitle {
        font-size: 0.62rem;
    }

    /* Hero Section on Small Screens */
    .hero-section {
        padding: 45px 0 75px 0;
    }
    .hero-title {
        font-size: 1.7rem;
    }
    .hero-desc {
        font-size: 0.92rem;
    }
    .hero-section .d-flex.flex-wrap.gap-3 {
        flex-direction: column;
        width: 100%;
        gap: 10px !important;
    }
    .hero-section .d-flex.flex-wrap.gap-3 > .btn {
        width: 100%;
        padding: 12px 18px !important;
        font-size: 0.92rem;
    }

    /* Section Titles */
    .section-title {
        font-size: 1.45rem !important;
    }
    .section-badge {
        font-size: 0.75rem;
        padding: 4px 12px;
    }

    /* Buttons */
    .btn-primary-custom,
    .btn-secondary-custom {
        padding: 9px 18px;
        font-size: 0.92rem;
    }

    /* Modal dialog */
    .modal-dialog {
        margin: 0.75rem;
    }
}

/* Article Content & Video Embeds */
.article-content {
    color: #334155;
    font-size: 1.05rem;
    line-height: 1.85;
}
.article-content p {
    margin-bottom: 1.25rem;
}
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1rem 0;
}
.article-content .ratio,
.article-content iframe {
    max-width: 100%;
    border: 0;
    border-radius: 12px;
}
.article-content .ratio {
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}
