/* =========================================
   1. VARIABLES & ROOT SETUP
   ========================================= */
   :root {
    --rimau-orange: #f79e28;
    --rimau-green: #00824c;
    --rimau-white: #ffffff;
    --navbar-height: 70px;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
}

/* =========================================
   2. GLOBAL BODY & RESET
   ========================================= */
body {
    background-image: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.2)), url("../img/bg-2.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    padding-top: var(--navbar-height);
    font-family: 'Inter', sans-serif;
    color: var(--rimau-white);
    
    /* Page Transition Setup */
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

body.page-loaded {
    opacity: 1;
}

body.home-bg {
    /* 
       NOTE: Default Home Background
       Background moved to ::before to apply blur
    */
    background-image: none;
}

body.home-bg::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    
    /* Background Image from previous logic */
    background-image: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.2)), url("../img/bg-1.jpg");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;

    /* Blur Effect */
    /* filter: blur(3px); */
    transform: scale(1.1); /* Remove white edges from blur */
}

/* =========================================
   3. NAVIGATION BAR
   ========================================= */
/* Modern Glass Navbar */
.navbar {
    height: var(--navbar-height);
    background: rgba(15, 15, 15, 0.7) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
    background: rgba(10, 10, 10, 0.95) !important;
    height: 65px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    color: var(--rimau-white) !important;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand img {
    filter: drop-shadow(0 0 8px rgba(247, 158, 40, 0.3));
    transition: all 0.3s ease;
}

.navbar-brand:hover img {
    filter: drop-shadow(0 0 12px rgba(247, 158, 40, 0.6));
}

/* Nav Link General Styling */
.nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 500;
    padding: 0.5rem 1.2rem !important;
    margin: 0 0.2rem;
    position: relative;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--rimau-white) !important;
}

.nav-link.active {
    color: var(--rimau-orange) !important;
}

/* Desktop Underline Effect */
.nav-link:not(.dropdown-toggle)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--rimau-orange);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:not(.dropdown-toggle):hover::after,
.nav-link:not(.dropdown-toggle).active::after {
    width: 70%;
}

/* Dropdown Arrow Animation */
.dropdown-toggle::after {
    vertical-align: middle;
    margin-left: 0.5em;
    transition: transform 0.3s ease, border-top-color 0.3s ease;
}

.dropdown-toggle:hover::after {
    border-top-color: var(--rimau-orange);
    transform: rotate(180deg);
}

/* Glass Dropdown Styling */
.dropdown-menu {
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-top: 10px;
}

.dropdown-item {
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 10px 20px;
    transition: all 0.2s ease;
    font-weight: 500;
}

/* Spacing between dropdown items */
.dropdown-menu .dropdown-item + .dropdown-item {
    margin-top: 6px;
}

.dropdown-item:hover, .dropdown-item:focus, .dropdown-item.active {
    background: var(--rimau-orange);
    color: white;
    transform: translateX(5px);
}

/* Scrollable Dropdown for history */
.scrollable-menu {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

.scrollable-menu::-webkit-scrollbar { width: 5px; }
.scrollable-menu::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.02); border-radius: 4px; }
.scrollable-menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 4px; }
.scrollable-menu::-webkit-scrollbar-thumb:hover { background: var(--rimau-orange); }

/* =========================================
   4. HOME PAGE COMPONENTS
   ========================================= */
/* Hero & Typography */
.hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    line-height: 1.1;
    background: linear-gradient(135deg, #ffffff 0%, var(--rimau-orange) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.3));
}

/* Stat Cards */
.stat-card {
    background: rgba(0, 130, 76, 0.15);
    border: 1px solid var(--rimau-green);
    border-radius: 25px;
    padding: 30px;
    transition: all 0.4s ease;
    cursor: pointer;
}

.stat-card:hover {
    background: var(--rimau-green);
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 130, 76, 0.4);
}

.stat-card .icon {
    font-size: 2.5rem;
    color: var(--rimau-orange);
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.stat-card:hover .icon {
    color: var(--rimau-white);
}

/* High Opacity Overrides for Home Page */
body.home-bg .navbar { background: rgba(15, 15, 15, 0.95) !important; }
body.home-bg .glass-pill {
    background: rgba(0, 0, 0, 0.85);
    border-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: none;
}
body.home-bg .stat-card {
    background: rgba(0, 130, 76, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
body.home-bg .stat-card:hover {
    background: rgb(0, 130, 76);
    transform: translateY(-5px);
}

/* =========================================
   5a. TAKJIL ADMIN ACTION BUTTONS
   ========================================= */
.takjil-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

@media (max-width: 576px) {
    .takjil-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .takjil-actions .btn {
        width: 100%;
    }
}

/* =========================================
   5b. TRANSFER PROOF THUMBNAILS
   ========================================= */
.transfer-proof-thumb,
.transfer-proof-thumb-admin {
    display: block;
    margin: 0 auto;
    max-width: 40px;
    max-height: 40px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 6px 14px rgba(0, 0, 0, 0.6);
}

@media (max-width: 576px) {
    .transfer-proof-thumb,
    .transfer-proof-thumb-admin {
        max-width: 34px;
        max-height: 34px;
    }
}

/* =========================================
   5. INNER PAGE COMPONENTS
   ========================================= */
.inner-page-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, var(--rimau-orange) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.summary-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 25px;
    height: 100%;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.summary-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    border-color: var(--rimau-orange);
}

.summary-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255);
    margin-bottom: 10px;
    font-weight: 600;
}

.summary-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--rimau-white);
}

/* =========================================
   6. TABLE STYLING
   ========================================= */
.table-responsive {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

#tabelrincian {
    margin-bottom: 0;
    border: none;
    color: var(--rimau-white);
}

#tabelrincian thead th {
    background: rgba(0, 130, 76, 0.85); /* Solid green header */
    color: white;
    font-weight: 700;
    border: none;
    padding: 18px;
    vertical-align: middle;
}

#tabelrincian tbody tr {
    background: rgba(20, 20, 20, 0.6);
    transition: all 0.2s ease;
}

#tabelrincian tbody tr:nth-of-type(odd) {
    background: rgba(255, 255, 255, 0.03);
}

#tabelrincian td {
    padding: 15px 18px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

.text-income { color: #4ade80 !important; font-weight: 700; }
.text-expense { color: #fbbf24 !important; font-weight: 700; }

/* Footer / Total Row */
.tfooter td {
    background: rgba(247, 158, 40, 0.7) !important;
    color: white !important;
    font-weight: 800;
    font-size: 1.1rem;
    border-top: 2px solid var(--rimau-orange);
}

/* =========================================
   7. UI ELEMENTS & BUTTONS
   ========================================= */
.btn-rimau {
    background: var(--rimau-orange);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(247, 158, 40, 0.3);
}

.btn-rimau:hover {
    background: #e68d1a;
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(247, 158, 40, 0.5);
    color: white;
}

.btn-outline-rimau {
    background: transparent;
    border: 2px solid var(--rimau-orange);
    color: var(--rimau-orange);
    padding: 13px 33px;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-outline-rimau:hover {
    background: var(--rimau-orange);
    color: white;
    transform: scale(1.05);
}

.glass-pill {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 8px 20px;
    display: inline-block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--rimau-orange);
    margin-bottom: 20px;
}

.alert-primary {
    background: rgba(13, 110, 253, 0.1);
    border: 1px solid rgba(13, 110, 253, 0.2);
    backdrop-filter: blur(10px);
    color: #8bb9ff;
    border-radius: 15px;
    padding: 20px;
}

/* =========================================
   8. ANIMATIONS
   ========================================= */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.animate-float { animation: float 6s ease-in-out infinite; }
.animate-fade-in { animation: fadeInScale 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

/* =========================================
   9. FOOTER SECTION
   ========================================= */
.glass-footer {
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 60px;
    padding-bottom: 40px;
    position: relative;
    z-index: 10;
}

.footer-links li { margin-bottom: 12px; }

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--rimau-orange);
    padding-left: 8px; /* Slight movement to right */
}

.footer-links a::before {
    content: '›';
    margin-right: 5px;
    opacity: 0;
    transition: all 0.3s ease;
    color: var(--rimau-orange);
}

.footer-links a:hover::before { opacity: 1; }

.social-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px; /* Soft square */
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.1rem;
}

.social-btn:hover {
    background: var(--rimau-orange);
    color: white;
    transform: translateY(-5px) rotate(5deg);
    box-shadow: 0 5px 15px rgba(247, 158, 40, 0.4);
    border-color: transparent;
}

/* =========================================
   10. MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 991px) {
    /* Navbar Mobile Adjustment */
    .navbar-collapse {
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 20px;
        border-radius: 15px;
        margin-top: 15px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
    .nav-item { margin-bottom: 5px; }

    .nav-link {
        padding: 12px 15px !important;
        border-radius: 10px;
        border: 1px solid transparent;
        transition: all 0.3s ease;
    }
    
    /* Remove desktop underline on mobile */
    .nav-link:not(.dropdown-toggle)::after { display: none !important; }
    
    /* Highlight for active/hover state on mobile */
    .nav-link.active, .nav-link:hover, .nav-link:focus {
        background: rgba(247, 158, 40, 0.15);
        color: var(--rimau-orange) !important;
        border-color: rgba(247, 158, 40, 0.3);
        transform: translateX(5px);
    }

    /* Mobile Dropdown Styling */
    .dropdown-menu {
        background: transparent;
        border: none;
        box-shadow: none;
        padding-left: 20px;
        margin-top: 5px;
    }
    .dropdown-item {
        padding: 10px 15px;
        border-left: 2px solid rgba(255,255,255,0.1);
        border-radius: 0 10px 10px 0;
    }
    .dropdown-item:hover, .dropdown-item.active {
        border-left-color: var(--rimau-orange);
        background: rgba(255,255,255,0.05);
        color: var(--rimau-orange);
    }

    /* Optimized Horizontal Scroll Table for Mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        /* Scroll visual cues shadows */
        background: 
            linear-gradient(to right, rgba(255,255,255,0.05) 30%, rgba(255,255,255,0) 100%),
            linear-gradient(to left, rgba(255,255,255,0.05) 30%, rgba(255,255,255,0) 100%);
        background-position: left center, right center;
        background-repeat: no-repeat;
        background-size: 20px 100%, 20px 100%;
        background-attachment: local, local;
        margin-bottom: 20px;
        border-radius: 12px;
        border: 1px solid rgba(255,255,255,0.1);
    }
    
    #tabelrincian {
        min-width: 800px;
        margin-bottom: 0;
    }

    /* Sticky First Column (Number) */
    #tabelrincian tbody th[scope="row"],
    #tabelrincian thead th:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        background: #ffffff; /* Solid White */
        color: #222222;      /* Black Text */
        border-right: 1px solid rgba(0,0,0,0.1);
    }

    #tabelrincian thead th { white-space: nowrap; }
    #tabelrincian td { vertical-align: top; }    
    /* Allow description to wrap */
    #tabelrincian td:nth-child(3) {
        white-space: normal;
        min-width: 250px;
    }
}

/* Mobile Toggler Icon Customization */
.navbar-toggler { border: none; padding: 0; }
.navbar-toggler:focus { box-shadow: none; }
.toggler-icon {
    width: 30px;
    height: 2px;
    background-color: var(--rimau-white);
    display: block;
    margin: 6px 0;
    transition: all 0.3s ease;
}
