/* 
   Sistem Pembayaran SMP MUHDI (SMP Muhammadiyah)
   Premium Design System Stylesheet
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --font-primary: 'Outfit', sans-serif;
    
    /* Light Theme (Slate & Indigo) */
    --bg-app: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-sidebar: #0f172a;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(226, 232, 240, 0.8);
    
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --accent-gradient: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --info-gradient: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
    --shadow-lg: 0 20px 25px -5px rgba(99, 102, 241, 0.08), 0 10px 10px -5px rgba(99, 102, 241, 0.03);
    
    --sidebar-width: 260px;
    --navbar-height: 70px;
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
}



* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.glass-card-sm {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
}

/* Typography Helpers */
.text-gradient-primary {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.text-gradient-accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Layout System */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling (Desktop) */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    transition: transform 0.3s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

.menu-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
    padding-left: 0.5rem;
}

.menu-section-title:first-of-type {
    margin-top: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    margin-bottom: 0.25rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-link i, .sidebar-link svg {
    margin-right: 0.85rem;
    width: 18px;
    height: 18px;
}

.sidebar-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    color: #ffffff;
    background: var(--primary-gradient);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.1);
}

/* Main Content Area */
.main-container {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* Navbar */
.top-navbar {
    height: var(--navbar-height);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.content-wrapper {
    flex: 1;
    padding: 2rem;
}

/* Mobile Bottom Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    z-index: 1030;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    width: 20%;
    height: 100%;
}

.mobile-nav-link i, .mobile-nav-link svg {
    width: 20px;
    height: 20px;
    margin-bottom: 3px;
}

.mobile-nav-link.active {
    color: #6366f1;
}

/* Custom Components & Utilities */
.btn-gradient-primary {
    background: var(--primary-gradient);
    color: white !important;
    border: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    font-weight: 500;
}

.btn-gradient-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.btn-gradient-accent {
    background: var(--accent-gradient);
    color: white !important;
    border: none;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
    font-weight: 500;
}

.btn-gradient-accent:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.3);
}

/* Card KPI Styles */
.kpi-card {
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    pointer-events: none;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 1rem;
}

/* Beautiful Inputs */
.form-control, .form-select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--border-radius-md);
    padding: 0.6rem 1rem;
}

.form-control:focus, .form-select:focus {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: #6366f1;
    color: var(--text-main);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}



/* Custom Table Styles */
.custom-table-container {
    overflow-x: auto;
}

.table {
    color: var(--text-main);
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.03);
}

/* Status Badges */
.badge-status {
    padding: 0.4em 0.8em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-status-lunas {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge-status-belum {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.badge-status-cicil {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1090;
}

/* Responsive Rules */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-container {
        margin-left: 0;
        padding-bottom: 65px; /* space for bottom nav */
    }
    .top-navbar {
        padding: 0 1.25rem;
    }
    .content-wrapper {
        padding: 1.25rem;
    }
    .mobile-nav {
        display: flex;
    }
}

/* Login Page Styling */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, #0f172a 0%, #020617 90%);
    position: relative;
    overflow: hidden;
}

.login-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(rgba(99, 102, 241, 0.1) 1px, transparent 0),
        radial-gradient(rgba(168, 85, 247, 0.08) 2px, transparent 0);
    background-size: 40px 40px, 60px 60px;
    background-position: 0 0, 20px 20px;
    pointer-events: none;
}

/* Print Invoice Stylesheet */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .sidebar, .top-navbar, .mobile-nav, .btn, .no-print, header, footer {
        display: none !important;
    }
    .main-container {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    .content-wrapper {
        padding: 0 !important;
    }
    .print-receipt-container {
        display: block !important;
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
        padding: 20px;
        border: none !important;
        box-shadow: none !important;
    }
    .glass-card, .glass-card-sm {
        background: transparent !important;
        backdrop-filter: none !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    .table th, .table td {
        border-bottom: 1px solid #ddd !important;
        color: #000 !important;
        padding: 8px !important;
    }
}

.print-receipt-container {
    display: none;
}

/* Collapsed Sidebar State for Desktop */
@media (min-width: 992px) {
    .app-wrapper.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
    }
    .app-wrapper.sidebar-collapsed .main-container {
        margin-left: 0;
    }
}

/* Sidebar Backdrop Overlay for Mobile */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1025;
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}
