/* =========================================================
   PPPKMNK - OSC PENJAJA - Central Stylesheet
   Theme: Deep Royal Blue & Red
   ========================================================= */

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
    /* Main Theme Colors from Image */
    --primary-blue: #0B4A8F;        /* Deep Blue Background */
    --primary-blue-dark: #063266;   /* Darker Blue for hover */
    
    --accent-red: #E31E24;          /* Red Button */
    --accent-red-dark: #B9181D;     /* Darker Red for hover */
    --accent-red-light: #FEE2E2;    /* Light red for backgrounds */

    --text-dark: #1F2937;
    --text-light: #6B7280;
    --border-color: #E5E7EB;

    /* Background theme */
    --page-bg: #F3F4F6;
    --page-bg-soft: #E5E7EB;

    /* Override Bootstrap's body bg variable */
    --bs-body-bg: #F3F4F6;
}

/* ---------- 2. BASE / GLOBAL BACKGROUND ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    background-color: var(--page-bg) !important;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    min-height: 100vh;
}

/* Force Bootstrap utility classes to respect the theme */
.bg-white {
    background-color: transparent !important;
}

.bg-light {
    background-color: var(--page-bg-soft) !important;
}

.section-transparent {
    background-color: transparent !important;
}

.section-soft-grey {
    background-color: var(--page-bg-soft) !important;
}

/* =========================================
   BOOTSTRAP OVERRIDES 
   (Automatically turns all .bg-danger into Blue,
   and .btn-danger into Red)
   ========================================= */
.bg-danger {
    background-color: var(--primary-blue) !important;
}
.text-danger {
    color: var(--accent-red) !important;
}
.btn-danger {
    background-color: var(--accent-red) !important;
    border-color: var(--accent-red) !important;
    color: white !important;
}
.btn-danger:hover {
    background-color: var(--accent-red-dark) !important;
    border-color: var(--accent-red-dark) !important;
}

/* ---------- 3. NAVBAR (White Theme) ---------- */
.navbar-custom {
    background: #FFFFFF !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 0.75rem 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-blue) !important;
    text-decoration: none;
}

.logo-container {
    width: 45px;
    height: 45px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
    background: #F3F4F6;
    border-radius: 6px;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: 2px solid var(--primary-blue);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2831, 41, 55, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ==========================================
   MOBILE FULL CANVAS MENU
   ========================================== */
.navbar-collapse {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: #FFFFFF;
    z-index: 9999;
    transition: left 0.3s ease-in-out;
    overflow-y: auto;
    padding: 1rem;
}

.navbar-collapse.show { left: 0; }
.navbar-collapse.collapsing { left: -100%; transition: left 0.3s ease-in-out; }

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-blue);
}

.mobile-menu-logo .logo-container { 
    width: 50px; 
    height: 50px; 
}

.mobile-close-btn {
    background: #F3F4F6;
    border: none;
    color: var(--text-dark);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-close-btn:hover {
    background: #E5E7EB;
    transform: rotate(90deg);
}

.navbar-nav {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
}

.nav-item { width: 100%; }

/* Mobile Links */
.nav-link {
    color: var(--text-dark) !important;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background: transparent;
    border: 1px solid transparent;
}

.nav-link:hover, .nav-link.active {
    background: #E0F2FE; /* Very light blue */
    color: var(--primary-blue) !important;
}

.nav-link i { 
    font-size: 1.1rem; 
    width: 24px; 
    text-align: center; 
    color: var(--primary-blue);
}

/* Dropdowns */
.dropdown-menu {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 0.5rem;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.dropdown-item {
    color: var(--text-dark) !important;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: #E0F2FE;
    color: var(--primary-blue) !important;
}

.dropdown-divider { border-color: var(--border-color); }

/* ---------- DESKTOP NAV OVERRIDES (992px and up) ---------- */
@media (min-width: 992px) {
    .navbar-collapse {
        position: static;
        width: auto;
        height: auto;
        background: transparent;
        padding: 0;
        overflow: visible;
    }

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

    .navbar-nav { flex-direction: row; width: auto; gap: 0.25rem; }
    .nav-item { width: auto; }

    /* Desktop Links */
    .nav-link {
        color: var(--text-dark) !important;
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
        background: transparent;
        border: none;
    }

    .nav-link:hover, .nav-link.active {
        background: #E0F2FE;
        color: var(--primary-blue) !important;
        transform: translateY(-2px);
    }

    .nav-link i {
        color: var(--primary-blue);
    }

    .logo-container { width: 50px; height: 50px; }
    .navbar-brand { font-size: 1.25rem; }

    .dropdown-menu {
        background: white;
        border: 1px solid var(--border-color);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        width: auto;
        min-width: 200px;
    }

    .dropdown-item { color: var(--text-dark) !important; }
    .dropdown-item:hover { background: #E0F2FE; color: var(--primary-blue) !important; }
    .dropdown-item.text-danger:hover { background: var(--accent-red-light); color: var(--accent-red) !important; }
}

/* ---------- 4. COMPONENTS ---------- */
.btn-primary-custom {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover {
    background-color: var(--primary-blue-dark);
    border-color: var(--primary-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(11, 74, 143, 0.3);
}

.card-custom {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.card-custom:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(11, 74, 143, 0.25);
}

.alert-custom { border-radius: 8px; border-left: 4px solid; }

.badge-custom { padding: 0.5em 1em; border-radius: 20px; font-weight: 500; }

.table-hover tbody tr:hover { background-color: #E0F2FE; }

.spinner-border-custom {
    border-color: var(--primary-blue);
    border-right-color: transparent;
}

/* ---------- 5. ADMIN SIDEBAR ---------- */
.sidebar {
    min-height: 100vh;
    background-color: white;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}

.sidebar .nav-link {
    color: var(--text-dark);
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    margin: 0.2rem 0;
    transition: all 0.2s ease;
}

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

.sidebar .nav-link.active {
    background-color: var(--primary-blue);
    color: white;
}

.sidebar .nav-link i { width: 20px; margin-right: 10px; color: inherit; }

/* ---------- 6. BODY SCROLL LOCK ---------- */
body.menu-open { overflow: hidden; }

/* ---------- 7. HOME PAGE: HERO ---------- */
.hero-mobile {
    background: linear-gradient(180deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 1.5rem 1rem;
}

.hero-mobile-content {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
    color: white;
}

.hero-mobile-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.hero-mobile-subtitle { font-size: 1.75rem; font-weight: 700; color: var(--accent-gold); margin-bottom: 1.5rem; }

.hero-mobile-logo { margin: 1.5rem auto; max-width: 200px; }

.hero-mobile-logo img {
    width: 100%;
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.hero-mobile-desc { font-size: 0.95rem; margin-bottom: 1rem; opacity: 0.95; }
.hero-mobile-text { font-size: 0.875rem; margin-bottom: 1.5rem; opacity: 0.9; }
.hero-mobile-buttons { display: flex; flex-direction: column; gap: 0.75rem; padding: 0 0.5rem; }

.btn-mobile {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 2px solid;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-mobile-primary { background: var(--accent-red); color: white; border-color: var(--accent-red); }
.btn-mobile-primary:hover { background: var(--accent-red-dark); transform: translateY(-2px); }
.btn-mobile-secondary { background: transparent; color: white; border-color: white; }
.btn-mobile-secondary:hover { background: rgba(255,255,255,0.1); }

.hero-desktop {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    position: relative;
    padding: 4rem 0;
}

.desktop-logo-container {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 350px;
    margin: 0 auto;
}

.hero-wave { position: absolute; bottom: 0; left: 0; width: 100%; line-height: 0; }
.hero-wave svg { display: block; width: 100%; height: 80px; }

/* ---------- 8. HOME PAGE: ACTIVITIES ---------- */
.activities-mobile-scroll {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding: 0 1rem 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.activities-mobile-scroll::-webkit-scrollbar { display: none; }

.activity-card-mobile {
    flex: 0 0 85%;
    max-width: 320px;
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    scroll-snap-align: center;
}

.activity-image-mobile { width: 100%; height: 200px; overflow: hidden; }
.activity-image-mobile img { width: 100%; height: 100%; object-fit: cover; }

.activity-no-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.activity-content-mobile { padding: 1.25rem; }
.activity-title-mobile { font-size: 1.1rem; font-weight: 700; color: #212529; margin-bottom: 0.75rem; }
.activity-meta-mobile { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.85rem; }
.meta-item { color: #6c757d; display: flex; align-items: center; }
.meta-item i { color: var(--accent-red); }

.activity-card-desktop {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.activity-card-desktop:hover { transform: translateY(-8px); box-shadow: 0 12px 24px rgba(0,0,0,0.15); }

.activity-image-desktop { position: relative; overflow: hidden; height: 250px; }
.activity-image-desktop img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.activity-card-desktop:hover .activity-image-desktop img { transform: scale(1.1); }

.activity-no-image-desktop {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.activity-content-desktop { padding: 1.5rem; }
.activity-title-desktop { font-size: 1.5rem; font-weight: 700; color: #212529; margin-bottom: 1rem; }
.activity-meta-desktop { display: flex; gap: 1.5rem; margin-bottom: 1rem; font-size: 0.95rem; flex-wrap: wrap; }
.activity-desc-desktop { color: #6c757d; line-height: 1.6; margin-bottom: 1rem; }
.read-more-link { color: var(--primary-blue); font-weight: 600; font-size: 0.95rem; }
.activity-card-desktop:hover .read-more-link { text-decoration: underline; color: var(--accent-red); }

.hover-card { transition: all 0.3s ease; }
.hover-card:hover { transform: translateY(-8px); box-shadow: 0 1rem 3rem rgba(0,0,0,0.175) !important; }

/* ---------- 9. RESPONSIVE TWEAKS ---------- */
@media (max-width: 576px) { .display-4 { font-size: 2rem; } }
@media (min-width: 992px) { .activity-image-desktop.h-100 { height: 100% !important; } }