:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --bg-color: #f0f2f5;
    --sidebar-width: 260px;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

/* Mencegah zoom cubitan layar dan efek membal saat mentok */
html,
body {
    touch-action: pan-y;
    overscroll-behavior-y: none;
}

/* Mencegah zoom otomatis saat mengklik kolom input / form */
input,
button,
select,
textarea {
    touch-action: manipulation;
    font-size: 16px !important;
}


body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%), radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%), radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    background-attachment: fixed;
    color: #333;
    overflow-x: hidden;
}

#login-app {
    background: url('') no-repeat center center/cover;
    transition: background 0.5s ease-in-out;
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.floating-logo-container {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translate3d(-50%, 0, 0);
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: float 4s ease-in-out infinite;
    will-change: transform;
}

.floating-logo {
    width: 70px;
    height: auto;
}

@keyframes float {
    0% {
        transform: translate3d(-50%, 0, 0);
    }

    50% {
        transform: translate3d(-50%, -10px, 0);
    }

    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

.hover-scale {
    transition: transform 0.2s;
}

.hover-scale:hover {
    transform: scale(1.02);
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1050;
    background: white;
    border-right: 1px solid #e0e0e0;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    transition: margin 0.3s;
    padding: 20px;
}

.nav-link {
    color: #555;
    margin: 5px 15px;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.nav-link:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.glass-card {
    background: white;
    border-radius: 16px;
    border: none;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
}

/* Mencegah kolom tombol dan tanggal terlipat/turun ke bawah */
.nowrap-cell {
    white-space: nowrap !important;
    width: 1%;
    /* Biar lebar kolomnya menyesuaikan isinya aja */
}

/* Memotong teks panjang maksimal 2 baris dengan titik-titik (...) */
.text-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    /* Lebar kira-kira 20 digit huruf */
    white-space: normal;
}

@media (max-width: 768px) {
    .sidebar {
        left: -260px;
    }

    .sidebar.show {
        left: 0;
    }

    .content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }

    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }

    .overlay.show {
        display: block;
    }

    .glass-card {
        padding: 1.5rem !important;
    }

    .login-card {
        backdrop-filter: none;
        background: rgba(255, 255, 255, 0.95);
    }
}

.w-md-25 {
    width: 25%;
}

@media (max-width: 768px) {
    .w-md-25 {
        width: 100%;
    }
}

/* Naikkan tombol scroll to top di layar HP */
#btn-back-to-top {
    position: fixed;
    bottom: 85px;
    right: 20px;
    display: none;
    /* Tersembunyi default */
    z-index: 1050;
    /* Di atas elemen lain */
    width: 45px;
    height: 45px;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#btn-back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* =========================================
   TAMPILAN KHUSUS HP (MOBILE APP STYLE)
========================================= */
@media (max-width: 768px) {

    /* Sembunyikan Sidebar & Navbar lama di HP */
    .sidebar,
    .navbar.bg-white.shadow-sm {
        display: none !important;
    }

    /* Beri ruang di atas dan bawah agar konten tidak tertutup menu */
    .content {
        margin-left: 0;
        width: 100%;
        padding: 75px 10px 85px 10px !important;
    }

    /* HEADER ATAS */
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
        z-index: 1050;
    }

    .mobile-header-left {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-header-left img {
        height: 35px;
        width: 35px;
        object-fit: contain;
    }

    .mobile-header-left span {
        font-weight: 700;
        color: var(--primary-color);
        font-size: 15px;
    }

    .mobile-header-right {
        display: flex;
        gap: 18px;
        align-items: center;
    }

    .top-icon-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: #666;
        cursor: pointer;
    }

    .top-icon-btn i {
        font-size: 18px;
        margin-bottom: 2px;
    }

    .top-icon-btn span {
        font-size: 9px;
        font-weight: 400;
        letter-spacing: 0.5px;
    }

    /* Tulisan tipis & kecil */

    /* MENU BAWAH (BOTTOM NAV) */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 65px;
        background: white;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 1050;
        border-radius: 20px 20px 0 0;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: #a0a0a0;
        text-decoration: none;
        width: 20%;
        cursor: pointer;
        transition: 0.3s;
    }

    .bottom-nav-item.active {
        color: var(--primary-color);
    }

    .bottom-nav-item.active i {
        transform: translateY(-2px);
    }

    .bottom-nav-item i {
        font-size: 20px;
        margin-bottom: 4px;
        transition: transform 0.2s;
    }

    .bottom-nav-item span {
        font-size: 10px;
        font-weight: 600;
    }

    /* TOMBOL HOME DI TENGAH (BERBEDA/MENGAMBANG) */
    .bottom-nav-item.home-btn {
        position: relative;
        top: -15px;
    }

    .bottom-nav-item.home-btn .fab-inner {
        background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
        width: 55px;
        height: 55px;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: 0 8px 20px rgba(67, 97, 238, 0.4);
        border: 4px solid var(--bg-color);
        color: white;
    }

    .bottom-nav-item.home-btn .fab-inner i {
        font-size: 22px;
        margin: 0;
        color: white !important;
    }

    .bottom-nav-item.home-btn span {
        position: absolute;
        bottom: -18px;
        color: var(--primary-color);
    }
}

/* --- ANIMASI RUNNING TEXT MODERN --- */
.marquee-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
    position: relative;
}

.marquee-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee-anim 15s linear infinite;
    /* Angka 15s adalah kecepatan, ubah jika ingin lebih cepat/lambat */
}

@keyframes marquee-anim {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-100%, 0);
    }
}

/* Sembunyikan menu mobile saat di Desktop/Laptop */
@media (min-width: 769px) {

    .mobile-header,
    .mobile-bottom-nav {
        display: none !important;
    }
}


/* --- EFEK GLASSMORPHISM & ANIMASI MELAYANG --- */
.glass-morphism-card {
    background: rgba(255, 255, 255, 0.15) !important;
    /* Dibuat lebih transparan biar efek kacanya terasa */
    backdrop-filter: blur(15px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(15px) saturate(120%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

#login-instansi-name, #login-school-name, #login-alamat-text, 
#loginForm label, #loginForm h4, #loginForm p {
    text-shadow: 0px 1px 3px rgba(255,255,255, 0.9), 0px 0px 5px rgba(255,255,255, 0.7);
}

/* Bola Cahaya Warna-warni di Belakang Kaca */
.color-blob {
    position: absolute;
    filter: blur(80px);
    z-index: 0;
    border-radius: 50%;
    animation: blob-bounce 10s infinite alternate ease-in-out;
}

.blob-biru {
    width: 350px;
    height: 350px;
    background: #4361ee;
    top: -50px;
    left: -50px;
    opacity: 0.6;
}

.blob-pink {
    width: 300px;
    height: 300px;
    background: #f72585;
    bottom: -50px;
    right: -50px;
    opacity: 0.5;
    animation-delay: -4s;
}

@keyframes blob-bounce {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.2);
    }
}

/* Rumus Melayang Lurus Naik-Turun (Tanpa geser kiri) */
@keyframes float-inline {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0);
    }
}

/* Animasi Logo Melayang (Diperbaiki agar tidak oleng) */
.anim-float-1 {
    animation: float-inline 3s ease-in-out infinite;
}

.anim-float-2 {
    animation: float-inline 4s ease-in-out infinite;
    animation-delay: 1.5s;
}

/* Animasi Tombol HP Melayang & Berdenyut */
@keyframes pulse-float {
    0% {
        transform: translateY(0) scale(1);
        box-shadow: 0 10px 20px rgba(67, 97, 238, 0.3);
    }

    50% {
        transform: translateY(-8px) scale(1.03);
        box-shadow: 0 15px 25px rgba(67, 97, 238, 0.6);
    }

    100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 10px 20px rgba(67, 97, 238, 0.3);
    }
}

.btn-float-mobile {
    animation: pulse-float 2.5s infinite ease-in-out;
}
