/* ========================================
   IMPORTS
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Poppins:wght@400;500;600;700&display=swap');

/* ========================================
   ROOT (TEMA BARU: "SLATE")
   ======================================== */
:root {
    /* Warna Abu-Biru (Slate) Profesional */
    --gray-50: #f8fafc;   /* (Slate-50) */
    --gray-100: #f1f5f9;  /* (Slate-100) */
    --gray-200: #e2e8f0;  /* (Slate-200) */
    --gray-300: #cbd5e1;  /* (Slate-300) */
    --gray-400: #94a3b8;  /* (Slate-400) */
    --gray-500: #64748b;  /* (Slate-500) */
    --gray-600: #475569;  /* (Slate-600) */
    --gray-700: #334155;  /* (Slate-700) */
    --gray-800: #1e293b;  /* (Slate-800) */
    --gray-900: #0f172a;  /* (Slate-900) */

    /* UPGRADE: Tema warna primer diubah ke Slate */
    --primary: var(--gray-600);
    --primary-dark: var(--gray-700);
    --primary-light: var(--gray-400);

    /* Warna Aksen (Hijau Mint) */
    --success: #10b981; 
    --info: #0ea5e9;
    --warning: #f59e0b;
    --danger: #ef4444;

    --white: #ffffff;
    --light: var(--gray-100);
    --dark: var(--gray-900);
    --border: var(--gray-300);

    /* Radius (Sedikit lebih bulat) */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadow (Lebih lembut) */
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 25px rgba(0,0,0,0.06);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.08);

    /* Transisi */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;

    /* Font */
    --font-base: 'Inter', 'Poppins', system-ui, -apple-system, sans-serif;
    --font-mono: 'Fira Code', Consolas, monospace;

    /* Layout */
    --navbar-height: 80px;
    --container-padding: 1rem;
}

/* ========================================
   UPGRADE: PRELOADER
   ======================================== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gray-900); /* Latar belakang gelap */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}
.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--gray-700);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   UPGRADE: CUSTOM CURSOR
   ======================================== */
body {
    cursor: none; /* Sembunyikan kursor default */
}
.cursor-dot,
.cursor-outline {
    pointer-events: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.2s ease-out;
}
.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-light);
}
.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary-light);
    mix-blend-mode: difference; /* Efek keren */
}
/* Tampilkan saat mouse di dalam body */
body:hover .cursor-dot,
body:hover .cursor-outline {
    opacity: 1;
}
/* Efek hover pada link/button */
a:hover ~ .cursor-outline,
button:hover ~ .cursor-outline,
.kegiatan-card:hover ~ .cursor-outline {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0.5;
}
a:hover ~ .cursor-dot,
button:hover ~ .cursor-dot,
.kegiatan-card:hover ~ .cursor-dot {
    transform: translate(-50%, -50%) scale(0);
}
/* Sembunyikan di mobile */
@media (max-width: 768px) {
    body { cursor: auto; }
    .cursor-dot, .cursor-outline { display: none; }
}

/* ========================================
   RE-SKIN: TIPOGRAFI & LAYOUT
   ======================================== */
html {
    scroll-behavior: smooth;
    font-size: 100%;
}
body {
    font-family: var(--font-base);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--gray-700);
    background-color: var(--gray-50); 
    min-height: 100vh;
    padding-top: var(--navbar-height);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
}
h1 { font-size: clamp(2.5rem, 5vw + 1rem, 3.5rem); }
h2 { font-size: clamp(1.8rem, 3vw, 2.2rem); }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.1rem; }
p { margin-bottom: 1rem; max-width: 65ch; }
small { font-size: 0.875rem; }
a { color: var(--primary); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--primary-dark); }
.container {
    width: 100%; padding: 0 var(--container-padding); margin: 0 auto;
}
@media (min-width: 576px) { .container { max-width: 540px; } }
@media (min-width: 768px) { .container { max-width: 720px; } }
@media (min-width: 992px) { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1320px; } }
section { padding: 5rem 0; position: relative; }
.section-title {
    text-align: center;
    position: relative;
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: 4rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 5px;
    background: var(--primary);
    border-radius: 3px;
}

/* ========================================
   RE-SKIN: NAVBAR
   ======================================== */
#mainNavbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1030;
    background: transparent !important;
    border-bottom: 1px solid transparent;
    padding: 1rem 0;
    height: var(--navbar-height);
    transition: all 0.4s ease;
    display: flex; align-items: center;
}
#mainNavbar.scrolled {
    /* UPGRADE: Efek "frosted glass" lebih jelas */
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: saturate(180%) blur(15px);
    -webkit-backdrop-filter: saturate(180%) blur(15px);
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--gray-200);
    padding: 0.75rem 0;
    height: 70px;
}
#mainNavbar .navbar-brand {
    font-weight: 800; font-size: 1.5rem; color: var(--white) !important;
    display: flex; align-items: center; gap: 0.5rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: color 0.3s ease;
}
#mainNavbar.scrolled .navbar-brand {
    color: var(--primary-dark) !important;
    text-shadow: none;
}
#mainNavbar .navbar-brand img {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
}
#mainNavbar .navbar-nav { gap: 0.5rem; }
#mainNavbar .nav-link {
    font-weight: 600; color: var(--white) !important;
    padding: 0.5rem 1rem !important; border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    position: relative;
}
#mainNavbar .nav-link::after { display: none; /* Hapus underline lama */ }

/* UPGRADE: Hover & Active state navbar baru */
#mainNavbar .nav-link:hover,
#mainNavbar .nav-link.active {
    color: var(--white) !important;
    background-color: rgba(255, 255, 255, 0.15);
}
#mainNavbar.scrolled .nav-link {
    color: var(--gray-600) !important;
    text-shadow: none; font-weight: 500;
}
#mainNavbar.scrolled .nav-link:hover {
    color: var(--primary-dark) !important;
    background-color: var(--gray-200);
}
#mainNavbar.scrolled .nav-link.active {
    color: var(--primary-dark) !important;
    background-color: var(--gray-100);
    font-weight: 700;
}
/* Tombol Login di Navbar */
#mainNavbar .btn-outline-light {
    border: 2px solid white; font-weight: 600;
    padding: 0.5rem 1rem; color: white;
}
#mainNavbar .btn-outline-light:hover {
    background: white; color: var(--primary-dark);
}
#mainNavbar.scrolled .btn-outline-light {
    border-color: var(--primary); color: var(--primary) !important;
    background: transparent;
}
#mainNavbar.scrolled .btn-outline-light:hover {
    background: var(--primary); color: white !important;
}
.navbar-toggler { border: none; padding: 0.25rem 0.5rem; }
.navbar-toggler:focus { box-shadow: none; }

/* ========================================
   RE-SKIN: HERO & ANIMASI TEKS
   ======================================== */
.hero-section {
    background: linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.65)),
                url('../images/karang_taruna_hero.jpg') center center / cover no-repeat fixed;
    color: white; text-align: center; padding: 0 1rem;
    min-height: 100vh;
    margin-top: calc(-1 * var(--navbar-height));
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.hero-content h1 {
    font-size: clamp(2.8rem, 8vw, 4.5rem);
    font-weight: 800; margin-bottom: 1.5rem;
    color: var(--white); letter-spacing: -0.5px;
}
.hero-content p {
    font-size: clamp(1.1rem, 2vw + 0.5rem, 1.25rem);
    max-width: 60ch; margin: 0 auto 2rem;
    /* Beri tinggi agar tidak "lompat" saat teks diketik */
    min-height: 2.5em; 
}
/* UPGRADE: Styling untuk kursor TypeIt */
span.ti-cursor {
    color: var(--primary-light);
    font-size: 1.3em;
    animation: blink 0.7s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Tombol di Hero */
.hero-content .btn {
    padding: 0.85rem 1.75rem; font-size: 1rem;
}
.hero-content .btn-primary {
    background: white; color: var(--primary-dark);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}
.hero-content .btn-primary:hover {
    background: var(--gray-100);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}
.hero-content .btn-outline-light { border-width: 2px; }
.hero-content .btn-outline-light:hover { background: rgba(255,255,255,0.1); }
/* Wave Divider */
.wave-bottom {
    position: absolute; bottom: -1px; left: 0;
    width: 100%; overflow: hidden; line-height: 0;
}
.wave-bottom svg {
    position: relative; display: block;
    width: calc(100% + 1.3px); height: 120px;
}
.wave-fill { fill: var(--gray-50); }

/* ========================================
   RE-SKIN: BUTTONS
   ======================================== */
.btn {
    font-weight: 600; padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition), background-position 0.5s ease;
    display: inline-flex; align-items: center; gap: 0.5rem;
    border: none; cursor: pointer; text-align: center;
    vertical-align: middle; user-select: none;
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn-primary {
    /* UPGRADE: Gradien abu-biru baru */
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(71, 85, 105, 0.3);
    background-size: 200% auto;
}
.btn-primary:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(71, 85, 105, 0.4);
}
.btn-outline-secondary {
    border: 1.5px solid var(--gray-400);
    color: var(--gray-600);
    background: transparent;
}
.btn-outline-secondary:hover {
    background: var(--gray-200);
    border-color: var(--gray-500);
    transform: translateY(-2px);
}

/* ========================================
   RE-SKIN: CARDS (Mendukung 3D Tilt)
   ======================================== */
.card {
    background: white; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200); /* Border lebih terang */
    overflow: hidden; height: 100%;
    display: flex; flex-direction: column;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}
.card-img-top { width: 100%; height: 200px; object-fit: cover; }
.card-body { padding: 1.5rem; flex-grow: 1; }
.card-title {
    font-size: 1.25rem; font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}
.card-text { color: var(--gray-600); }
.card-footer {
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}
/* Card Khusus (Summary, Feature) */
.summary-card {
    background: var(--white); border-radius: var(--radius-xl);
    padding: 2rem; box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    height: 100%;
}
.feature-card { padding: 2.5rem 2rem; }
.feature-icon {
    font-size: 2.5rem; color: var(--primary);
    margin-bottom: 1.5rem; display: block;
}
.justified-text { text-align: justify; }

/* Kartu 3D Tilt */
.kegiatan-card,
.feature-card {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.kegiatan-card:hover {
    transition-duration: 0.4s;
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-lg) !important;
}
.feature-card:hover {
    transition-duration: 0.4s;
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}
.kegiatan-card img { transition: transform 0.5s ease; }
.kegiatan-card:hover img { transform: scale(1.08); }

/* Badge Kategori */
.badge {
    font-weight: 600; font-size: 0.8rem;
    text-transform: capitalize; padding: 0.4em 0.8em;
    border-radius: var(--radius-full);
    display: inline-block; text-align: center;
    min-width: 80px;
}
.bg-gradient-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
}
.bg-gradient-info {
    background: linear-gradient(135deg, var(--info), #0284c7);
    color: white;
}

/* ========================================
   RE-SKIN: FORM, PAGINATION, MODAL
   ======================================== */
.form-control,
.form-select {
    display: block; width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem; transition: var(--transition);
    background-color: var(--white);
    color: var(--gray-700);
}
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(71, 85, 105, 0.15);
    outline: none;
}
.form-label {
    font-weight: 600; color: var(--gray-700);
    margin-bottom: 0.5rem;
}
.pagination {
    display: flex; flex-wrap: wrap; gap: 0.5rem;
    padding-left: 0; list-style: none; justify-content: center;
}
.page-link {
    border: 1.5px solid var(--border); color: var(--primary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm) !important;
    font-weight: 500; display: block; position: relative;
    transition: var(--transition-fast);
}
.page-item.active .page-link {
    background: var(--primary); border-color: var(--primary);
    color: white; z-index: 3;
}
.page-link:hover {
    background: var(--gray-100);
    border-color: var(--gray-400); z-index: 2;
}
.modal-content {
    border-radius: var(--radius-lg); border: none;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.25rem 1.5rem;
}
.modal-title {
    font-weight: 700; font-size: 1.25rem;
    color: var(--white);
}
.modal-body { padding: 1.5rem; }
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background-color: var(--gray-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ========================================
   RE-SKIN: FOOTER
   ======================================== */
footer {
    background: linear-gradient(to bottom, var(--gray-800), var(--gray-900));
    color: var(--gray-300); padding: 3rem 0;
    margin-top: auto; text-align: center;
}
footer p { margin: 0 auto 1rem; }
footer a {
    color: var(--gray-400); font-weight: 500;
    transition: var(--transition-fast); display: inline-block;
}
footer a:hover { color: white; transform: translateY(-2px); }
footer .social-links {
    display: flex; justify-content: center; gap: 1.5rem;
    margin-bottom: 1.5rem;
}
footer .social-links a { font-size: 1.5rem; margin: 0; }

/* ========================================
   RE-SKIN: FIXED BUTTONS & DROPDOWN
   ======================================== */
@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(71, 85, 105, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(71, 85, 105, 0); }
    100% { box-shadow: 0 0 0 0 rgba(71, 85, 105, 0); }
}
.notification-bell-fixed,
.btn-scroll-top {
    position: fixed; bottom: 20px; z-index: 1050;
    width: 50px; height: 50px; border-radius: 50%;
    background: var(--primary); color: white;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-lg); cursor: pointer;
    transition: var(--transition); border: none;
    animation: pulse-glow 2.5s infinite;
}
.btn-scroll-top { 
    right: 20px; opacity: 0; visibility: hidden; 
    transform: translateY(20px);
}
.btn-scroll-top.show {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.notification-bell-fixed:hover,
.btn-scroll-top:hover {
    transform: translateY(-5px) scale(1.1);
    background: var(--primary-dark);
    animation-play-state: paused; /* Hentikan denyut saat di-hover */
}
.notification-bell-fixed .badge {
    position: absolute; top: -5px; right: -5px;
    font-size: 0.65rem; min-width: 18px; height: 18px;
    border-radius: 50%; background: var(--danger);
    display: flex; align-items: center; justify-content: center;
}
/* Dropdown Notifikasi */
.dropup-center {
    position: fixed; bottom: 20px; left: 20px; z-index: 1050;
}
.notification-bell-fixed {
    position: relative; bottom: auto; left: auto;
}
.notification-dropdown {
    margin-bottom: 0.75rem !important;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    width: 380px; max-width: 90vw;
}
.notification-dropdown-body {
    max-height: 400px; overflow-y: auto;
}
.notification-dropdown-body .badge {
    font-size: 0.7rem; align-self: center;
}
@media (max-width: 576px) {
    .dropup-center { left: 15px; bottom: 15px; }
}

/* ========================================
   RESPONSIVE (Tema Baru)
   ======================================== */
@media (max-width: 992px) {
    h1 { font-size: 2.25rem; }
    h2, .section-title { font-size: 1.75rem; }
    section { padding: 3rem 0; }
    .section-title { margin-bottom: 3rem; }
}
@media (max-width: 768px) {
    :root { --navbar-height: 70px; }
    .navbar.scrolled { height: 65px; }
    #mainNavbar .navbar-brand { font-size: 1.25rem; }
    #mainNavbar .navbar-brand img { width: 32px; height: 32px; }
    section { padding: 2.5rem 0; }
    .hero-section {
        padding: 8rem 1rem 6rem;
        margin-top: calc(-1 * var(--navbar-height));
        background-attachment: scroll;
    }
    .wave-bottom svg { height: 80px; }
}
@media (max-width: 576px) {
    :root { --navbar-height: 65px; }
    h1 { font-size: 2rem; }
    h2, .section-title { font-size: 1.6rem; }
    .btn { padding: 0.75rem 1.3rem; font-size: 0.9rem; }
    .hero-content .btn { width: 100%; margin-bottom: 0.5rem; }
    .card-body { padding: 1.25rem; }
    .summary-card { padding: 1.5rem; }
    .modal-body { padding: 1.25rem; }
    .modal-footer { padding: 1rem 1.25rem; }
    .wave-bottom svg { height: 60px; }
    .btn-scroll-top { right: 15px; bottom: 15px; }
}