/* =====================================================
   MTs Daerah Tambakrejo - Main Stylesheet
   Color Theme: Navy (#1a365d), Gold (#d4af37), White (#fff)
   ===================================================== */

:root {
    --primary: #1a365d;
    --primary-dark: #0f2340;
    --secondary: #d4af37;
    --secondary-light: #e5c76b;
    --white: #ffffff;
    --light: #f8f9fa;
    --gray: #6c757d;
    --dark: #212529;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 5px 30px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Navbar ===== */
.navbar {
    padding: 1rem 0;
    background: transparent;
    transition: var(--transition);
}

.navbar.scrolled {
    background: var(--primary);
    box-shadow: var(--shadow);
    padding: 0.5rem 0;
}

.navbar-brand .brand-text {
    line-height: 1.2;
}

.navbar-brand .brand-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.navbar-brand .brand-tagline {
    font-size: 0.75rem;
    opacity: 0.8;
}

.navbar-nav .nav-link {
    color: var(--white) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--secondary) !important;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: var(--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(--shadow-lg);
    border-radius: 0.5rem;
}

.dropdown-item:hover {
    background: var(--primary);
    color: var(--white);
}

/* ===== Hero Section ===== */
.hero-section {
    position: relative;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
}

.hero-slider {
    height: 100%;
    position: relative;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
    background-size: cover;
    background-position: center;
}

.hero-slide.active {
    opacity: 1;
}

.hero-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.9) 0%, rgba(26, 54, 93, 0.6) 100%);
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--white);
    width: 90%;
    max-width: 800px;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-buttons {
    animation: fadeInUp 1s ease 0.4s both;
}

.hero-indicators {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 3;
}

.hero-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.hero-indicator.active {
    background: var(--secondary);
    transform: scale(1.2);
}

/* ===== Buttons ===== */
.btn-primary {
    background: var(--secondary);
    border-color: var(--secondary);
    color: var(--primary);
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 50px;
}

.btn-primary:hover {
    background: var(--secondary-light);
    border-color: var(--secondary-light);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-outline-light {
    border-width: 2px;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 50px;
}

.btn-outline-light:hover {
    background: var(--white);
    color: var(--primary);
    transform: translateY(-2px);
}

/* ===== Sections ===== */
.section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.section-title p {
    color: var(--gray);
    font-size: 1.1rem;
}

.section-title .title-line {
    width: 80px;
    height: 4px;
    background: var(--secondary);
    margin: 1rem auto;
    border-radius: 2px;
}

.bg-light {
    background: var(--light) !important;
}

/* ===== Stats Section ===== */
.stats-section {
    background: var(--primary);
    padding: 3rem 0;
    margin-top: -5rem;
    position: relative;
    z-index: 10;
}

.stat-card {
    text-align: center;
    color: var(--white);
    padding: 1.5rem;
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-card p {
    margin: 0;
    opacity: 0.8;
}

/* ===== Cards ===== */
.card {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--gray);
    font-size: 0.95rem;
}

/* ===== News Cards ===== */
.news-card .card-meta {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.news-card .card-meta i {
    color: var(--secondary);
}

/* ===== Profile Cards ===== */
.profile-card {
    text-align: center;
    padding: 2rem;
}

.profile-card .profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--secondary);
    margin-bottom: 1rem;
}

.profile-card h5 {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.profile-card .position {
    color: var(--secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.profile-card .subject {
    color: var(--gray);
    font-size: 0.85rem;
}

/* ===== Gallery Grid ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26, 54, 93, 0.9) 0%, transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay h6 {
    color: var(--white);
    font-weight: 600;
    margin: 0;
}

.gallery-item .video-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
    z-index: 5;
    transition: var(--transition);
}

.gallery-item:hover .video-badge {
    background: var(--secondary);
    color: var(--primary);
    transform: translate(-50%, -50%) scale(1.1);
}

/* ===== Prestasi Timeline ===== */
.prestasi-card {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.prestasi-card:hover {
    transform: translateX(10px);
}

.prestasi-icon {
    width: 60px;
    height: 60px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.prestasi-icon i {
    font-size: 1.5rem;
    color: var(--primary);
}

.prestasi-content h5 {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.prestasi-content .badge {
    font-weight: 500;
    padding: 0.4rem 0.8rem;
}

.badge-kabupaten {
    background: #28a745;
}

.badge-provinsi {
    background: #17a2b8;
}

.badge-nasional {
    background: #dc3545;
}

/* ===== Page Header ===== */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 8rem 0 4rem;
    text-align: center;
    color: var(--white);
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-header .breadcrumb {
    justify-content: center;
    margin: 0;
}

.page-header .breadcrumb-item a {
    color: var(--secondary);
}

.page-header .breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.7);
}

.breadcrumb-item+.breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.5);
}

/* ===== Contact Form ===== */
.contact-form .form-control {
    border-radius: 0.5rem;
    padding: 0.8rem 1rem;
    border: 1px solid #dee2e6;
}

.contact-form .form-control:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25);
}

.contact-info-card {
    background: var(--primary);
    color: var(--white);
    padding: 2rem;
    border-radius: 1rem;
    height: 100%;
}

.contact-info-card h5 {
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.contact-info-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-info-item i {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
}

/* ===== Footer ===== */
.footer {
    background: var(--primary-dark);
    color: var(--white);
}

.footer-main {
    padding: 4rem 0 2rem;
}

.footer-brand img {
    margin-bottom: 1rem;
}

.footer-brand h5 {
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.footer-brand p {
    opacity: 0.8;
    font-size: 0.9rem;
}

.footer-title {
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--secondary);
}

.footer-links i {
    margin-right: 0.5rem;
    font-size: 0.75rem;
}

.footer-contact .contact-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.footer-contact i {
    color: var(--secondary);
    width: 20px;
    margin-top: 0.25rem;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.social-link:hover {
    background: var(--secondary);
    color: var(--primary);
    transform: translateY(-3px);
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem 0;
    text-align: center;
    font-size: 0.9rem;
}

/* ===== Back to Top ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 45px;
    height: 45px;
    background: var(--secondary);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: var(--shadow);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    color: var(--primary);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Alerts ===== */
.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
}

/* ===== Pagination ===== */
.pagination .page-link {
    color: var(--primary);
    border-radius: 0.5rem;
    margin: 0 0.25rem;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* ===== Responsive ===== */
@media (max-width: 991px) {
    .navbar-collapse {
        background: var(--primary);
        padding: 1rem;
        border-radius: 0.5rem;
        margin-top: 1rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .stats-section {
        margin-top: 0;
    }
}

@media (max-width: 767px) {
    .section {
        padding: 3rem 0;
    }

    .section-title h2 {
        font-size: 1.75rem;
    }

    .hero-section {
        min-height: 500px;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .stat-card h3 {
        font-size: 2rem;
    }

    .page-header {
        padding: 6rem 0 3rem;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .prestasi-card {
        flex-direction: column;
        text-align: center;
    }

    .prestasi-icon {
        margin: 0 auto;
    }
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 0.5rem;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
}

.lightbox-content {
    width: 90%;
    max-width: 1000px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-container {
    width: 100%;
    aspect-ratio: 16/9;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border-radius: 0.5rem;
}