/* Global Styles */
:root {
    --primary-color: #43A047;
    /* Softer, professional Green */
    --primary-dark: #2E7D32;
    /* Darker shade for contrast */
    --primary-light: #E8F5E9;
    /* Very light green for backgrounds */
    --text-color: #333;
    --white: #ffffff;
    --bg-color: #f4f6f8;
    /* Modern light gray/blueish bg */
    --footer-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    /* Modern font stack */
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Header & Navigation */
header {
    background-color: var(--white);
    /* White header for modern look */
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 50px;
    /* Logo height */
    width: auto;
}

.logo a {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-decoration: none;
    margin-left: 10px;
}

.nav-links {
    display: flex;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
    font-weight: 700;
    /* Optional: make it bold */
    border-bottom: 2px solid var(--primary-color);
    /* Optional: add underline */
}

/* Login Button in Nav */
.btn-login-nav {
    background-color: var(--primary-color);
    color: var(--white) !important;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600 !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(67, 160, 71, 0.2);
}

.btn-login-nav:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(67, 160, 71, 0.3);
    border-bottom: none !important;
    /* Override active link style */
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Main Content */
main {
    flex: 1;
    margin-top: 70px;
    /* Offset for fixed header */
    margin-bottom: var(--footer-height);
    /* Offset for fixed footer */
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
    align-self: center;
}

.hero {
    text-align: center;
    padding: 4rem 1rem;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* Card Styles */
/* Card Styles */
.card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
    display: block;
    /* Ensure it works as a link */
    text-decoration: none;
    /* Remove underline */
    color: var(--text-color);
    /* Inherit text color */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(67, 160, 71, 0.2);
    background-color: var(--white);
    text-decoration: none;
    color: var(--text-color);
}

.card h3 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-weight: 700;
}

/* Hero Carousel (Jumbotron) */
.hero-carousel {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 24px 16px 36px;
    margin-bottom: 0;
}

.carousel {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: auto;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    background: #fff;
}

.carousel-inner {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
    height: auto;
}

.carousel-item {
    min-width: 100%;
    position: relative;
    height: auto;
}

.carousel-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 3 / 2;
}

.carousel-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    color: var(--primary-dark);
    border: none;
    width: 48px;
    height: 48px;
    cursor: pointer;
    font-size: 1.4rem;
    transition: all 0.25s ease;
    border-radius: 50%;
    margin: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

.carousel-control:hover {
    background: var(--white);
    transform: translateY(-50%) scale(1.08);
}

.prev {
    left: 0;
}

.next {
    right: 0;
}

.carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 5;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

.carousel-dot.active {
    background: var(--white);
    transform: scale(1.25);
}

/* Hero Call-To-Action Cards */
.hero-cta {
    max-width: 1200px;
    margin: -28px auto 2.5rem;
    padding: 0 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    position: relative;
    z-index: 4;
}

.hero-cta-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 14px;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-cta-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.hero-cta-card.primary {
    background: linear-gradient(135deg, #ff7a00 0%, #ff5a1f 100%);
    color: #fff;
}

.hero-cta-card.outline {
    background: #fff;
    color: var(--primary-dark);
    border: 2px solid var(--primary-color);
}

.hero-cta-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: rgba(255, 255, 255, 0.25);
}

.hero-cta-card.outline .hero-cta-icon {
    background: rgba(0, 100, 0, 0.08);
    color: var(--primary-color);
}

.hero-cta-text {
    flex: 1;
    min-width: 0;
}

.hero-cta-text h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.25;
}

.hero-cta-text p {
    font-size: 0.88rem;
    margin: 0;
    opacity: 0.92;
    line-height: 1.4;
}

.hero-cta-arrow {
    flex-shrink: 0;
    font-size: 1.1rem;
    opacity: 0.85;
    transition: transform 0.25s ease;
}

.hero-cta-card:hover .hero-cta-arrow {
    transform: translateX(4px);
}

/* Modern Home Sections */
.home-section {
    padding: 4rem 1rem;
    position: relative;
}

.home-section-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.section-eyebrow {
    display: block;
    text-align: center;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.section-title {
    text-align: center;
    color: var(--primary-dark);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    line-height: 1.2;
}

.section-divider {
    display: block;
    width: 64px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: 2px;
    margin: 0 auto 1.25rem;
}

.section-lead {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 2rem;
    color: #555;
    font-size: 1.02rem;
    line-height: 1.7;
}

/* Welcome Section */
.home-welcome {
    background: var(--white);
    padding-top: 3.5rem;
    padding-bottom: 2.5rem;
}

/* Stats Section */
.home-stats {
    background: linear-gradient(135deg, var(--primary-light) 0%, #d6ecd8 100%);
    padding: 3rem 1rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.stat-tile {
    background: var(--white);
    border-radius: 16px;
    padding: 1.75rem 1.25rem;
    text-align: center;
    box-shadow: 0 8px 20px rgba(46, 125, 50, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

.stat-tile:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(46, 125, 50, 0.18);
}

.stat-tile-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
}

.stat-tile-number {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.stat-tile-label {
    color: #666;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Programs Section */
.home-programs {
    background: var(--bg-color);
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.program-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    border: 1px solid rgba(67, 160, 71, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.program-card::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), rgba(67, 160, 71, 0.08));
    transition: transform 0.4s ease;
    z-index: 0;
}

.program-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 35px rgba(46, 125, 50, 0.15);
    border-color: var(--primary-color);
}

.program-card:hover::after {
    transform: scale(1.6);
}

.program-card-icon {
    position: relative;
    z-index: 1;
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 6px 14px rgba(46, 125, 50, 0.3);
}

.program-card h3 {
    position: relative;
    z-index: 1;
    color: var(--primary-dark);
    font-size: 1.18rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.program-card p {
    position: relative;
    z-index: 1;
    color: #666;
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 1rem;
    flex: 1;
}

.program-card-arrow {
    position: relative;
    z-index: 1;
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 600;
    align-self: flex-start;
    transition: transform 0.3s ease;
}

.program-card:hover .program-card-arrow {
    transform: translateX(6px);
}

/* Features (Why Choose Us) */
.home-features {
    background: var(--white);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.feature-item {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #fafffb 0%, #ffffff 100%);
    border: 1px solid #ebf2ec;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(46, 125, 50, 0.12);
}

.feature-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-color);
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    transition: background 0.3s ease, color 0.3s ease;
}

.feature-item:hover .feature-icon {
    background: var(--primary-color);
    color: var(--white);
}

.feature-item h3 {
    color: var(--primary-dark);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.feature-item p {
    color: #666;
    font-size: 0.92rem;
    line-height: 1.6;
}

/* News Section on Home */
.home-news {
    background: var(--bg-color);
}

.home-news-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white) !important;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(46, 125, 50, 0.25);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.home-news-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(46, 125, 50, 0.35);
}

@media (max-width: 768px) {
    .home-section {
        padding: 2.5rem 1rem;
    }

    .section-title {
        font-size: 1.55rem;
    }

    .section-lead {
        font-size: 0.95rem;
    }

    .stat-tile-number {
        font-size: 2rem;
    }

    .program-card {
        padding: 1.5rem 1.25rem;
    }
}

/* Enhanced Footer */
footer {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 2rem 1rem;
    display: block;
    /* Changed from flex to block/grid for multi-column */
    position: relative;
    /* Remove fixed to allow content to grow */
    width: 100%;
    height: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h3 {
    margin-bottom: 1.2rem;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--primary-light);
    display: inline-block;
    padding-bottom: 5px;
}

.footer-section p,
.footer-section a {
    color: #f1f1f1;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: flex-start;
    /* Align icon to top of text */
    gap: 10px;
    text-decoration: none;
    line-height: 1.5;
}

.footer-section i {
    margin-top: 4px;
    /* Slight optical adjustment */
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.footer-section a:hover {
    color: var(--primary-light);
    transform: translateX(5px);
    transition: transform 0.3s, color 0.3s;
}

/* Responsive Footer Grid */
@media screen and (min-width: 600px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 992px) {
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

.copyright {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
}

/* Update Main to remove bottom margin since footer is no longer fixed */
main {
    margin-bottom: 0;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        /* Match header bg */
        flex-direction: column;
        align-items: center;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        max-height: 500px;
        padding-bottom: 1rem;
    }

    .nav-links li {
        margin: 1rem 0;
    }

    .nav-links a {
        color: var(--text-color);
        /* Ensure visibility on white bg */
    }

    .hamburger {
        display: block;
    }

    .logo a {
        font-size: 1rem;
        /* Smaller text on mobile */
    }

    .hero-carousel {
        padding: 16px 12px 28px;
    }

    .carousel {
        border-radius: 12px;
    }

    .carousel-control {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
        margin: 0 8px;
    }

    .carousel-dots {
        bottom: 10px;
    }

    .carousel-dot {
        width: 10px;
        height: 10px;
    }

    .hero-cta {
        margin: -20px auto 2rem;
        gap: 12px;
    }

    .hero-cta-card {
        padding: 16px 18px;
        gap: 12px;
    }

    .hero-cta-icon {
        width: 46px;
        height: 46px;
        font-size: 1.3rem;
    }

    .hero-cta-text h3 {
        font-size: 0.98rem;
    }

    .hero-cta-text p {
        font-size: 0.82rem;
    }

    .navbar {
        padding: 0.5rem;
    }
}

/* Featured News Grid */
.news-grid-featured {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

@media screen and (min-width: 481px) {
    .news-grid-featured {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 769px) {
    .news-grid-featured {
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: auto auto;
    }

    /* 
       Layout for 5 items:
       Row 1: 2 Large items (span 3 cols each) - Half width each
       Row 2: 3 Small items (span 2 cols each) - Third width each
    */

    /* Item 1 & 2: Big Cards */
    .news-card-featured:nth-child(1),
    .news-card-featured:nth-child(2) {
        grid-column: span 3;
        min-height: 400px;
    }

    .news-card-featured:nth-child(1) .news-thumb,
    .news-card-featured:nth-child(2) .news-thumb {
        height: 250px;
        /* Taller images for big cards */
    }

    /* Item 3, 4, 5: Small Cards */
    .news-card-featured:nth-child(3),
    .news-card-featured:nth-child(4),
    .news-card-featured:nth-child(5) {
        grid-column: span 2;
        min-height: 300px;
    }
}

.news-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.news-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #eee;
}

.news-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-title {
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-weight: 700;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media screen and (max-width: 768px) {
    .news-title {
        font-size: 1.1rem;
    }
    
    .news-excerpt {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .news-content {
        padding: 1rem;
    }
}

.news-date {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 1rem;
}

.news-excerpt {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    flex: 1;
}

.read-more {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    transition: background 0.3s;
    align-self: flex-start;
}

.read-more:hover {
    background-color: var(--primary-dark);
}

/* Ekstrakurikuler Section */
.ekskul-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 0 20px;
}

.ekskul-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.ekskul-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(67, 160, 71, 0.2);
    border-color: var(--primary-color);
}

.ekskul-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 15px rgba(67, 160, 71, 0.3);
}

.ekskul-icon i {
    font-size: 2rem;
    color: var(--white);
}

.ekskul-card h4 {
    color: var(--primary-dark);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.ekskul-card p {
    color: var(--text-color);
    font-size: 0.9rem;
    margin: 0;
}

/* Responsive Ekstrakurikuler */
@media screen and (max-width: 768px) {
    .ekskul-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }

    .ekskul-card {
        padding: 1.5rem 1rem;
    }

    .ekskul-icon {
        width: 60px;
        height: 60px;
    }

    .ekskul-icon i {
        font-size: 1.5rem;
    }

    .ekskul-card h4 {
        font-size: 1rem;
    }

    .ekskul-card p {
        font-size: 0.85rem;
    }
}