/* Custom Properties (Variables) for easy color changes and consistency */
:root {
    --primary-color: #004d40; /* Dark Teal / Hijau Gelap Kehijauan */
    --secondary-color: #ffb300; /* Amber / Kuning Keemasan untuk aksen */
    --accent-color: #e67e22; /* Oranye untuk CTA kedua */
    --text-dark: #333333;
    --text-light: #f8f8f8;
    --bg-light: #f5f5f5;
    --border-color: #e0e0e0;
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --font-heading: 'Merriweather', serif;
    --font-body: 'Poppins', sans-serif;
    --transition-speed: 0.3s;
}

/* Base Styles */
*, *::before, *::after {
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

body {
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased; /* Better font rendering on macOS */
    -moz-osx-font-smoothing: grayscale; /* Better font rendering on macOS */
    overflow-x: hidden; /* Prevent horizontal scroll bar from layout issues */
}

body.no-scroll { /* Added for mobile menu scroll lock */
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--secondary-color);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    line-height: 1.3;
}

h2.section-title {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 10px;
}

h2.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 5px;
}

.section-spacing {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.text-center {
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95em;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: 2px solid transparent;
    user-select: none; /* Prevent text selection on buttons */
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #003e35; /* Darker shade of primary */
    border-color: #003e35;
    box-shadow: 0 6px 12px var(--shadow-medium);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--accent-color);
    color: var(--text-light);
    border-color: var(--accent-color);
}

.btn-secondary:hover {
    background-color: #bf661a; /* Darker shade of accent */
    border-color: #bf661a;
    box-shadow: 0 6px 12px var(--shadow-medium);
    transform: translateY(-2px);
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: var(--text-light);
    box-shadow: 0 4px 8px var(--shadow-light);
}

/* --- Header --- */
.main-header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px var(--shadow-light);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-speed) ease;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Vertically align items in the header */
    flex-wrap: nowrap; /* Prevent wrapping on desktop */
}

.main-header .logo {
    display: flex;
    align-items: center;
    /* Remove any fixed widths or max-widths if present */
}

.main-header .logo a {
    display: flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    white-space: nowrap; /* Keep logo and text on one line */
}

.main-header .logo img {
    height: 50px;
    margin-right: 15px;
    flex-shrink: 0; /* Prevent image from shrinking */
}

.main-header .logo h1 {
    font-size: 1.8em;
    margin: 0;
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.2; /* Adjust line height if text is wrapping */
}

.main-nav {
    display: flex;
    align-items: center;
    flex-grow: 1; /* Allow navigation to take available space */
    justify-content: flex-end; /* Push nav content to the right */
}

.main-nav .nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 30px; /* Space between main navigation items */
}

.main-nav .nav-links li {
    position: relative;
}

.main-nav .nav-links a {
    color: var(--text-dark);
    font-weight: 600;
    padding: 10px 0;
    display: block;
    position: relative;
    white-space: nowrap; /* Prevent menu items from wrapping */
}

.main-nav .nav-links a.btn-login {
    color: var(--primary-color); /* Text color for login button */
}


.main-nav .nav-links a:not(.btn-login)::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width var(--transition-speed) ease-in-out;
}

.main-nav .nav-links a:not(.btn-login):hover::after,
.main-nav .nav-links a.active-link:not(.btn-login)::after { /* active-link class added by JS for current page */
    width: 100%;
}

/* Dropdown Menu */
.main-nav .nav-links .dropdown-menu {
    display: none;
    position: absolute;
    background-color: #ffffff;
    box-shadow: 0 8px 16px var(--shadow-medium);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    min-width: 220px;
    z-index: 100;
    border-radius: 8px;
    animation: fadeIn 0.3s ease-out;
    top: calc(100% + 10px); /* Position slightly below parent */
    left: 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none; /* Disable events until visible */
}

.main-nav .nav-links .dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.main-nav .nav-links .dropdown-menu li {
    width: 100%;
}

.main-nav .nav-links .dropdown-menu a {
    padding: 10px 20px;
    color: var(--text-dark);
    font-weight: 400;
    white-space: nowrap;
}

.main-nav .nav-links .dropdown-menu a:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.main-nav .nav-links .dropdown .dropdown-icon {
    font-size: 0.7em;
    margin-left: 5px;
    transition: transform var(--transition-speed) ease;
}

.main-nav .nav-links .dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

/* Login Button in Navbar */
.main-nav .nav-links .btn-login {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    transition: all var(--transition-speed) ease;
    border: none;
    box-shadow: 0 4px 8px rgba(255, 179, 0, 0.2);
    margin-left: 15px; /* Add some space from the last nav item */
}

.main-nav .nav-links .btn-login:hover {
    background-color: #ffc133; /* Slightly lighter yellow for hover */
    color: var(--text-dark);
    box-shadow: 0 6px 12px rgba(255, 179, 0, 0.3);
    transform: translateY(-2px);
}

.main-nav .search-icon {
    font-size: 1.4em;
    color: var(--primary-color);
    cursor: pointer;
    margin-left: 25px; /* Space from login button or last nav item */
    transition: color var(--transition-speed) ease;
}

.main-nav .search-icon:hover {
    color: var(--secondary-color);
}

.mobile-menu-toggle {
    font-size: 1.6em; /* Slightly larger icon */
    color: var(--primary-color);
    cursor: pointer;
    margin-left: 25px;
    display: none; /* Hidden by default on desktop */
    transition: color var(--transition-speed) ease;
}

.mobile-menu-toggle:hover {
    color: var(--secondary-color);
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    background-color: #000;
    display: flex; /* Ensure flex container for slider */
}

.hero-slider {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Smooth cubic-bezier transition */
}

.hero-slide {
    min-width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
}

.hero-overlay .container {
    padding: 0 30px;
    max-width: 900px; /* Limit content width */
}

.hero-overlay h2 {
    font-size: 3.5em;
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
}

.hero-overlay p {
    font-size: 1.25em;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: #e0e0e0;
}

.hero-cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.hero-cta-buttons .btn {
    padding: 14px 30px;
    font-size: 1.1em;
    border-radius: 50px; /* Pill shape */
}

.hero-cta-buttons .btn-primary {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border-color: var(--secondary-color);
}
.hero-cta-buttons .btn-primary:hover {
    background-color: #ffc133;
    border-color: #ffc133;
    color: var(--primary-color);
}

.hero-cta-buttons .btn-secondary {
    background-color: transparent;
    color: var(--text-light);
    border-color: var(--text-light);
}
.hero-cta-buttons .btn-secondary:hover {
    background-color: var(--text-light);
    color: var(--primary-color);
    border-color: var(--text-light);
}

.slider-nav-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.slider-nav-dots .dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.slider-nav-dots .dot.active {
    background-color: #ffffff;
    transform: scale(1.2);
}

/* --- Why Choose Us Section --- */
.why-choose-us .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-item {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-light);
    text-align: center;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.feature-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px var(--shadow-medium);
}

.feature-icon {
    font-size: 3.5em;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.feature-item h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.feature-item p {
    font-size: 0.95em;
    color: #666;
}

/* --- News & Announcements Section --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.news-item {
    background-color: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-light);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-medium);
}

.news-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.news-content {
    padding: 25px;
}

.news-date {
    display: block;
    font-size: 0.85em;
    color: #888;
    margin-bottom: 10px;
}

.news-date i {
    margin-right: 5px;
    color: var(--secondary-color);
}

.news-item h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
}

.news-item h3 a {
    color: var(--primary-color);
    display: block;
    transition: color var(--transition-speed) ease;
}

.news-item h3 a:hover {
    color: var(--secondary-color);
}

.news-item p {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit to 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-item .read-more {
    font-weight: 600;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
}

.news-item .read-more i {
    margin-left: 8px;
    transition: margin-left var(--transition-speed) ease;
}

.news-item .read-more:hover i {
    margin-left: 12px;
}

/* --- Agenda Kegiatan Section --- */
.agenda-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.agenda-item {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px var(--shadow-light);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    border-left: 5px solid var(--primary-color);
}

.agenda-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px var(--shadow-medium);
}

.agenda-date-box {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 15px 10px;
    border-radius: 8px;
    text-align: center;
    font-family: var(--font-heading);
    margin-right: 20px;
    min-width: 80px;
    flex-shrink: 0; /* Prevent it from shrinking */
}

.agenda-date-box .day {
    font-size: 2em;
    font-weight: 700;
    display: block;
    line-height: 1;
}

.agenda-date-box .month {
    font-size: 0.9em;
    display: block;
    text-transform: uppercase;
}

.agenda-details h4 {
    font-size: 1.2em;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.agenda-details p {
    font-size: 0.9em;
    color: #666;
    margin: 0;
}

.agenda-details p i {
    margin-right: 5px;
    color: var(--secondary-color);
}

/* --- Footer --- */
.main-footer {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 60px 0 20px;
    font-size: 0.95em;
}

.main-footer a {
    color: var(--text-light);
    transition: color var(--transition-speed) ease;
}

.main-footer a:hover {
    color: var(--secondary-color);
}

.main-footer h3 {
    color: #ffffff;
    font-size: 1.4em;
    margin-bottom: 25px;
}

.main-footer .footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col .footer-logo {
    height: 70px;
    margin-bottom: 15px;
}

.footer-col.about-us h3 {
    margin-top: 10px;
    font-size: 1.8em;
}

.footer-col.about-us p {
    color: #c0c0c0;
    line-height: 1.7;
}

.footer-col.quick-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col.quick-links li {
    margin-bottom: 10px;
}

.footer-col.quick-links li a {
    display: inline-block;
    position: relative;
    padding-left: 15px;
}

.footer-col.quick-links li a::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
}

.footer-col.contact-info p {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    color: #c0c0c0;
}

.footer-col.contact-info i {
    margin-right: 10px;
    color: var(--secondary-color);
    font-size: 1.1em;
    margin-top: 4px;
}

.social-links {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.social-links a {
    font-size: 1.5em;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.social-links a:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    margin-top: 40px;
}

.footer-bottom p {
    color: #a0a0a0;
    font-size: 0.85em;
}

/* Back to Top Button */
#backToTopBtn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    font-size: 1.2em;
    box-shadow: 0 4px 8px var(--shadow-medium);
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

#backToTopBtn:hover {
    background-color: #ffc133; /* Slightly lighter yellow */
    transform: translateY(-3px);
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .main-header .logo h1 {
        font-size: 1.6em;
    }
    .main-nav .nav-links {
        gap: 20px;
    }
    .hero-overlay h2 {
        font-size: 2.8em;
    }
    .hero-overlay p {
        font-size: 1.1em;
    }
    h2.section-title {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .main-header .container {
        flex-wrap: wrap;
        /* justify-content: space-between; */ /* Removed as .main-nav now handles it better */
        flex-direction: row; /* Ensure logo and toggle/search stay on one row */
    }

    .main-header .logo {
        margin-bottom: 0;
        /* flex-grow: 1; */ /* Allow logo to take space if needed, but watch out for squishing */
        flex-shrink: 0;
    }

    .main-nav {
        flex-grow: 1; /* Allow nav to take remaining space */
        justify-content: flex-end; /* Push toggle/search to the right */
        order: 2; /* Ensure it's on the right of the logo */
    }

    .main-nav .nav-links {
        display: none; /* Hidden by default for mobile */
        flex-direction: column;
        width: 100%; /* Take full width */
        background-color: #ffffff;
        box-shadow: 0 5px 15px var(--shadow-light);
        position: absolute;
        top: calc(100% + 15px); /* Position below header, with some gap */
        left: 0;
        padding: 20px 0;
        border-radius: 8px;
        align-items: center; /* Center items in mobile menu */
        gap: 10px; /* Reduce gap between menu items */
        animation: slideDown 0.3s ease-out forwards; /* Add slide down animation */
        max-height: calc(100vh - 100px); /* Limit height to prevent overflow on very small screens */
        overflow-y: auto; /* Enable scroll if menu is too long */
    }

    .main-nav .nav-links.active {
        display: flex; /* Show when active */
    }

    .main-nav .nav-links li {
        width: 90%; /* Make list items take more width */
        text-align: center;
        margin-bottom: 5px; /* Adjust spacing */
    }

    .main-nav .nav-links a {
        padding: 12px 20px;
        font-size: 1.1em;
        width: 100%;
        text-align: center;
    }

    .main-nav .nav-links a:not(.btn-login)::after {
        left: 50%;
        transform: translateX(-50%);
        width: 0; /* Reset width to 0 for initial state */
        height: 2px;
        background-color: var(--secondary-color);
        transition: width var(--transition-speed) ease-in-out;
    }
    .main-nav .nav-links a:not(.btn-login):hover::after,
    .main-nav .nav-links a.active-link:not(.btn-login)::after {
        width: 60px; /* Shorter underline for mobile */
    }


    .main-nav .nav-links .dropdown-menu {
        position: static;
        box-shadow: none;
        width: 100%;
        background-color: var(--bg-light);
        padding: 5px 0;
        border-radius: 0;
        margin-top: 5px;
        opacity: 1; /* Always visible when parent is active on mobile */
        transform: translateY(0); /* Reset transform */
        animation: none; /* No fade in animation for mobile dropdown */
        display: none; /* Controlled by JS click, not hover */
    }
    .main-nav .nav-links .dropdown.open .dropdown-menu { /* .open class added by JS */
        display: block;
    }

    .main-nav .mobile-menu-toggle {
        display: block; /* Show toggle button */
        margin-left: 15px; /* Space from search icon if it exists */
        margin-right: 0;
    }
    .main-nav .search-icon {
        margin-left: 0; /* Remove left margin */
        margin-right: 15px; /* Space between search and hamburger */
    }
    /* No need for 'order' on .main-nav or .logo if they naturally stack correctly */


    .hero-section {
        height: 450px;
    }
    .hero-overlay h2 {
        font-size: 2.2em;
    }
    .hero-overlay p {
        font-size: 1em;
    }
    .hero-cta-buttons {
        flex-direction: column;
        gap: 15px;
    }
    .hero-cta-buttons .btn {
        width: 80%;
        max-width: 300px;
        margin: 0 auto;
    }

    .why-choose-us .features-grid,
    .news-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .footer-col {
        text-align: center;
    }
    .footer-col.about-us,
    .footer-col.quick-links,
    .footer-col.contact-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .footer-col.quick-links li a {
        padding-left: 0;
        text-align: center;
    }
    .footer-col.quick-links li a::before {
        display: none;
    }
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .main-header .logo img {
        height: 40px;
    }
    .main-header .logo h1 {
        font-size: 1.4em;
    }
    .hero-section {
        height: 350px;
    }
    .hero-overlay h2 {
        font-size: 1.6em;
    }
    .hero-overlay p {
        font-size: 0.85em;
        margin-bottom: 20px;
    }
    .hero-cta-buttons .btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    h2.section-title {
        font-size: 1.8em;
    }
    .feature-item {
        padding: 25px;
    }
    .feature-icon {
        font-size: 3em;
    }
    .news-content {
        padding: 20px;
    }
    .agenda-date-box {
        padding: 10px 5px;
        min-width: 60px;
    }
    .agenda-date-box .day {
        font-size: 1.8em;
    }
    .agenda-details h4 {
        font-size: 1.1em;
    }
    .agenda-details p {
        font-size: 0.85em;
    }
}

/* Keyframe Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}