/* ==========================================================================
   FKMPI JATIM - FULL MOBILE RESPONSIVE ENGINE (FIX GARIS BAGAN)
   ========================================================================== */

/* Pastikan Menu Burger disembunyikan di layar Desktop/Laptop */
@media screen and (min-width: 769px) {
    #mobile-menu, .menu-toggle {
        display: none !important;
    }
}

/* ==========================================================================
   TABLET & MOBILE (SCREEN < 768px)
   ========================================================================== */
@media screen and (max-width: 768px) {
    
    /* --- 1. GLOBAL & CONTAINER --- */
    html, body {
        overflow-x: hidden !important; 
        max-width: 100vw !important; 
        position: relative !important;
    }
    .container {
        width: 90% !important;
        padding: 0 15px !important;
        margin: 0 auto !important;
    }

    /* --- 2. NAVBAR & HAMBURGER MENU --- */
    .nav-container {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0 25px !important; 
        box-sizing: border-box !important;
    }

    #mobile-menu {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        width: 30px !important;
        height: 22px !important;
        cursor: pointer !important;
        z-index: 100000 !important;
        background: transparent !important;
        border: none !important;
        position: relative !important;
    }
    
    #mobile-menu .bar {
        display: block !important;
        height: 3px !important;
        width: 100% !important;
        background-color: #ffffff !important;
        border-radius: 5px !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.8) !important;
    }

    #mobile-menu.is-active .bar:nth-child(1) {
        transform: translateY(9.5px) rotate(45deg) !important;
        background-color: #bd53ff !important;
    }
    #mobile-menu.is-active .bar:nth-child(2) {
        opacity: 0 !important;
    }
    #mobile-menu.is-active .bar:nth-child(3) {
        transform: translateY(-9.5px) rotate(-45deg) !important;
        background-color: #bd53ff !important;
    }

    /* --- 3. MENU SLIDE-IN --- */
    .nav-links {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important; 
        transform: translateX(100%) !important; 
        width: 260px !important; 
        height: 100vh !important;
        background-color: #130b2e !important;
        border-left: 1px solid rgba(189, 83, 255, 0.3) !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important; 
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: -10px 0 30px rgba(0,0,0,0.8) !important;
        z-index: 99999 !important;
        padding: 0 !important;
    }

    .nav-links.active {
        transform: translateX(0) !important; 
    }

    .nav-links li {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important; 
        margin: 8px 0 !important;
    }
    
    .nav-links li a {
        width: 75% !important; 
        text-align: center !important; 
        font-size: 1.1rem !important;
        padding: 12px 0 !important;
        border-radius: 12px !important;
        display: block !important;
    }

    .nav-links li a::after {
        display: none !important; 
    }

    .nav-links li a:hover,
    .nav-links li a.active {
        background: rgba(189, 83, 255, 0.15) !important;
        color: #bd53ff !important;
    }

    .user-dropdown-wrapper {
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
        margin-top: 25px !important;
    }
    
    .nav-user-initial, .nav-user-img {
        margin: 0 auto !important; 
    }

    /* --- 4. HERO SECTION --- */
    .hero-container {
        display: flex !important;
        flex-direction: column-reverse !important;
        align-items: center !important;
        text-align: center !important;
        padding-top: 30px !important;
    }
    .hero-content {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    .hero-image-wrapper {
        width: 85% !important;
        margin-bottom: 30px !important;
    }
    .hero-content h1 {
        font-size: 1.5rem !important; 
        margin-bottom: 5px !important;
    }
    .hero-content .subtitle {
        font-size: 2.6rem !important; 
        white-space: nowrap !important; 
        line-height: 1.2 !important;
        margin-top: 0 !important;
        margin-bottom: 15px !important;
    }
    .hero-desc {
        font-size: 0.95rem !important;
        text-align: center !important;
    }
    .hero-social-wrapper {
        justify-content: center !important;
    }

    /* --- 5. PROFIL SECTION --- */
    .profile-content-wrapper {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }
    .profile-right-content {
        width: 100% !important;
        order: -1 !important;
        margin-bottom: 30px !important;
        display: flex !important;
        justify-content: center !important;
    }
    .profile-left-content {
        width: 100% !important;
    }
    .profile-tab-container {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    .logo-spotlight-circle {
        width: 220px !important;
        height: 220px !important;
    }
    .plain-text-p {
        text-align: justify !important;
    }

    /* --- 6. POLITEKNIK SECTION --- */
    .poly-grid-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    .poly-card-box {
        padding: 15px 10px !important;
    }
    .poly-logo-graphic {
        width: 60px !important;
        height: 60px !important;
    }
    .poly-fullname-label {
        font-size: 0.75rem !important;
    }

    /* --- 7. PROKER & SERTIFIKAT SECTION --- */
    .proker-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
    .proker-card {
        height: auto !important; 
        min-height: 400px !important;
    }
    .proker-card > div {
        height: auto !important;
        min-height: 50% !important;
    }

    /* --- 8. STRUKTUR SECTION (FIX KESELARASAN GARIS) --- */
    .structure-section {
        width: 100vw !important;
        overflow: hidden !important; 
    }
    
    .chart-tree-container {
        transform: none !important; 
        margin-bottom: 20px !important; 
        width: 100% !important;
        
        /* Set ke flex agar scroll lebih stabil */
        display: flex !important; 
        justify-content: flex-start !important; 
        
        overflow-x: auto !important; 
        -webkit-overflow-scrolling: touch !important; 
        padding-bottom: 25px !important;
        padding-top: 20px !important;
        
        scrollbar-width: none !important; 
        -ms-overflow-style: none !important; 
    }

    .chart-tree-container::-webkit-scrollbar {
        display: none !important;
    }

    /* KUNCI UTAMA: Paksa struktur tidak menyusut sama sekali */
    .chart-tree-container > * { 
        min-width: 1100px !important; /* Skala pas seukuran layar laptop */
        flex-shrink: 0 !important; /* Anti penyusutan */
        margin: 0 auto !important; 
    }
    
    /* --- 9. MATIKAN ELEMEN BERAT --- */
    .spotlight-beam { display: none !important; }
}

/* ==========================================================================
   EXTRA SMALL MOBILE (SCREEN < 480px)
   ========================================================================== */
@media screen and (max-width: 480px) {
    .poly-grid-container {
        grid-template-columns: 1fr !important;
    }
    .hero-content .subtitle {
        font-size: 2.2rem !important; 
    }
}