/* ==========================================================================
   MARIMOI - MAIN DARK CSS (Global Styles, Navbar & Responsive)
   ========================================================================== */

/* ==========================================================================
   1. GLOBAL STYLES & VARIABLES
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #007fff;
    --primary-dark: #0066cc;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --bg-primary: #0a0f1e;
    --bg-secondary: #151c31;
    --bg-overlay: rgba(10, 15, 30, 0.95);
}

/* Default Browser Scrollbar */
html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: "Inter", sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Container Class */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   2. NAVBAR SECTION
   ========================================================================== */

/* Base Navbar Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 15, 30, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
    padding: 1rem 1.5rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.3s ease, backdrop-filter 0.3s ease;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Navbar scroll states */
.navbar.scrolled {
    background: rgba(10, 15, 30, 0.98);
    backdrop-filter: blur(20px);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.navbar.hidden {
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop-only navbar hide behavior */
@media (min-width: 769px) {
    .navbar.hidden {
        transform: translateY(-100%);
    }
}

/* Always visible on mobile */
@media (max-width: 768px) {
    .navbar {
        background: rgba(10, 15, 30, 0.98);
        backdrop-filter: blur(15px);
    }

    .navbar.hidden {
        transform: translateY(0) !important;
    }
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1002;
}

.nav-content img {
    height: 40px !important;
    padding: 0 0 0 20px !important;
}

/* Logo */
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: "Poppins", sans-serif;
    letter-spacing: -1px;
    text-decoration: none;
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.logo:hover {
    color: var(--primary);
}

/* Desktop Navigation */
.nav-menu {
    display: flex;
    align-items: center;
    padding-right: 20px;
}

.menu-list {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.menu-list li {
    position: relative;
}

.menu-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.menu-list a:hover,
.menu-list a.active {
    color: var(--text-primary);
}

/* Underline effect for desktop */
.menu-list a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.menu-list a:hover::after,
.menu-list a.active::after {
    width: 100%;
}

/* Mobile Menu Button */
.mobile-menu-button {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1006;
    position: relative;
    outline: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.mobile-menu-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-button span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 1px;
    margin: 2px 0;
    transform-origin: center;
}

.mobile-menu-button.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
    background-color: var(--primary);
}

.mobile-menu-button.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-button.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    background-color: var(--primary);
}

.mobile-menu-button.active {
    background: rgba(0, 127, 255, 0.2);
    border-color: var(--primary);
    transform: scale(1.05);
}

/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.dropdown-trigger:hover {
    color: var(--text-primary);
}

.dropdown-trigger .arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease, color 0.3s ease;
    opacity: 0.8;
    color: var(--text-secondary);
    transform-origin: center;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-secondary);
    min-width: 220px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    list-style: none;
    z-index: 100;
}

.dropdown-menu li {
    list-style: none;
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    border-radius: 4px;
    position: relative;
}

.dropdown-menu a::after {
    display: none;
}

.dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(3px);
}

/* Desktop dropdown behavior */
@media (min-width: 769px) {
    .dropdown:hover .arrow {
        transform: rotate(180deg);
        color: var(--primary);
    }

    .dropdown:hover .dropdown-trigger {
        color: var(--text-primary);
    }

    .dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    /* Active state for dropdown */
    .dropdown.active .arrow {
        transform: rotate(180deg) !important;
        color: var(--primary) !important;
    }

    .dropdown.active .dropdown-trigger {
        color: var(--text-primary);
    }

    .dropdown.active .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    /* Improved dropdown positioning for better UX */
    .dropdown-menu {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .dropdown-menu::before {
        content: "";
        position: absolute;
        top: -8px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-bottom: 8px solid var(--bg-secondary);
        filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.1));
    }
}

/* Navbar Mobile Styles */
@media (max-width: 768px) {
    .navbar {
        padding: 0.75rem 1rem;
        background: rgba(10, 15, 30, 0.98);
        backdrop-filter: blur(8px);
    }

    .nav-content {
        position: relative;
        z-index: 1008;
    }

    .nav-content img {
        height: 30px !important;
        padding: 0 0 0 8px !important;
    }

    .mobile-menu-button {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background: var(--bg-primary);
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        padding: 0;
        transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        z-index: 1005;
        overflow-y: auto;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .nav-menu::-webkit-scrollbar {
        width: 6px;
    }

    .nav-menu::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
    }

    .nav-menu::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 3px;
    }

    .nav-menu.active {
        right: 0;
        animation: slideInRight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        filter: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    @keyframes slideInRight {
        from {
            right: -100%;
        }
        to {
            right: 0;
        }
    }

    .menu-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        padding: 20px 25px;
        margin: 0;
    }

    .menu-list > li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        width: 100%;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .menu-list > li:last-child {
        border-bottom: none;
    }

    .menu-list a {
        display: block;
        padding: 1rem 0;
        font-size: 1.1rem;
        font-weight: 600;
        border-radius: 0;
        position: relative;
        overflow: hidden;
        transition: all 0.3s ease;
        color: var(--text-primary);
        text-shadow: none;
        text-decoration: none;
    }

    .menu-list a::before {
        content: "";
        position: absolute;
        left: -100%;
        top: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent
        );
        transition: left 0.5s ease;
    }

    .menu-list a:hover::before {
        left: 100%;
    }

    .menu-list a:hover {
        color: var(--primary);
        transform: translateX(10px);
    }

    .menu-list a::after {
        display: none;
    }

    /* Mobile dropdown */
    .dropdown-menu {
        position: static;
        transform: none;
        background: rgba(21, 28, 49, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 8px;
        margin: 0;
        padding: 0;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }

    .dropdown.active .dropdown-menu {
        opacity: 1;
        visibility: visible;
        max-height: 150px;
        margin: 10px 0;
        padding: 8px;
    }

    .dropdown.active .arrow {
        transform: rotate(180deg) !important;
        color: var(--primary) !important;
        transition: transform 0.3s ease, color 0.3s ease;
    }

    .dropdown.active .dropdown-trigger {
        color: var(--primary);
    }

    .dropdown-trigger .arrow {
        margin-left: auto;
        font-size: 0.75em;
        transition: transform 0.3s ease, color 0.3s ease;
        color: var(--text-secondary);
        flex-shrink: 0;
        min-width: 16px;
        text-align: center;
        transform-origin: center;
        display: inline-block;
    }

    .dropdown-menu a {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: 6px;
        margin-bottom: 2px;
        color: var(--text-secondary);
        transition: all 0.3s ease;
        display: block;
        text-decoration: none;
        font-weight: 500;
    }

    .dropdown-menu a:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: translateX(5px);
        color: var(--text-primary);
    }

    .dropdown-menu a:last-child {
        margin-bottom: 0;
    }

    .arrow {
        margin-left: auto;
        font-size: 0.75em;
        transition: transform 0.3s ease, color 0.3s ease;
        color: var(--text-secondary);
        flex-shrink: 0;
        min-width: 16px;
        text-align: center;
    }

    /* Specific mobile dropdown trigger */
    .dropdown-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 1rem 0;
        text-decoration: none;
        color: var(--text-primary);
        font-size: 1.1rem;
        font-weight: 600;
        border-radius: 0;
        position: relative;
        overflow: hidden;
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .dropdown-trigger::before {
        content: "";
        position: absolute;
        left: -100%;
        top: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent
        );
        transition: left 0.5s ease;
    }

    .dropdown-trigger:hover::before {
        left: 100%;
    }

    .dropdown-trigger:hover {
        color: var(--primary);
        transform: translateX(10px);
    }

    .dropdown-trigger::after {
        display: none;
    }

    /* Fix regular menu links to not apply dropdown trigger styles */
    .menu-list > li:not(.dropdown) > a {
        display: block;
        padding: 1rem 0;
        font-size: 1.1rem;
        font-weight: 600;
        border-radius: 0;
        position: relative;
        overflow: hidden;
        transition: all 0.3s ease;
        color: var(--text-primary);
        text-shadow: none;
        text-decoration: none;
    }
}

/* Mobile overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1003;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Desktop styles - hide mobile elements */
@media (min-width: 769px) {
    .mobile-menu-overlay {
        display: none;
    }

    .mobile-menu-button {
        display: none;
    }
}

/* ==========================================================================
   3. GLOBAL RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .map-3d-container {
        display: flex;
        order: 2;
        width: 100%;
        height: 300px;
    }

    .hero-content {
        order: 1;
        text-align: center;
        margin-bottom: 2rem;
    }

    .running-item {
        margin-right: 40px;
    }

    .running-item img {
        height: 24px;
    }

    .running-item span {
        font-size: 24px;
    }

    .section {
        padding: 60px 1rem;
    }

    .peta-tematik .section-title {
        font-size: 2.5rem;
    }

    .fitur-utama {
        padding: 60px 0;
    }

    .indikator-pembangunan {
        padding: 60px 0;
    }

    .aspirasi {
        padding: 60px 1rem;
    }

    .about-section {
        padding: 60px 0 0 0;
        min-height: 50vh;
    }

    .footer {
        padding: 40px 0 0;
    }

    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
        letter-spacing: 4px;
    }

    .hero p {
        font-size: 16px;
    }

    .cta-button {
        padding: 12px 24px;
        font-size: 1rem;
    }

    .running-item {
        margin-right: 30px;
    }

    .running-item img {
        height: 20px;
    }

    .running-item span {
        font-size: 20px;
    }

    .section {
        padding: 40px 1rem;
    }

    .peta-tematik .section-title {
        font-size: 2rem;
    }

    .container {
        padding: 0 10px;
    }
}

/* ==========================================================================
   4. UTILITY CLASSES
   ========================================================================== */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}

.flex {
    display: flex;
}

.grid {
    display: grid;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.gap-1 {
    gap: 1rem;
}

.gap-2 {
    gap: 2rem;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}
