/* assets/css/style.css */

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

/* Variables */
:root {
    --bg-gradient: radial-gradient(circle at 50% 50%, #1a1b35 0%, #0a0b10 100%);
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-bg-hover: rgba(255, 255, 255, 0.06);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-focus: rgba(255, 255, 255, 0.2);
    
    --primary: #6366f1;       /* Indigo */
    --primary-glow: rgba(99, 102, 241, 0.35);
    --secondary: #ec4899;     /* Pink */
    --accent: #14b8a6;        /* Teal */
    --info: #0ea5e9;          /* Sky Blue */
    --warning: #f59e0b;       /* Amber */
    --danger: #ef4444;        /* Red */
    --success: #10b981;       /* Emerald */
    
    --text-main: #f3f4f6;     /* Off-white */
    --text-muted: #9ca3af;    /* Gray */
    --text-dark: #111827;     /* Dark Gray */
    
    --glass-blur: blur(12px);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --navbar-bg: rgba(10, 11, 16, 0.7);
    --modal-bg: #11121d;
    --input-bg: rgba(0, 0, 0, 0.2);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.light-theme {
    --bg-gradient: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    --card-bg: rgba(255, 255, 255, 0.65);
    --card-bg-hover: rgba(255, 255, 255, 0.95);
    --card-border: rgba(0, 0, 0, 0.06);
    --card-border-focus: rgba(0, 0, 0, 0.15);
    
    --text-main: #1f2937;
    --text-muted: #4b5563;
    
    --navbar-bg: rgba(243, 244, 246, 0.85);
    --modal-bg: #ffffff;
    --input-bg: rgba(255, 255, 255, 0.8);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Glassmorphism container */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.glass-panel:hover {
    background: var(--card-bg-hover);
    border-color: var(--card-border-focus);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 16px 80px 16px;
}

/* Navigation Bar */
header.navbar {
    background: var(--navbar-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 24px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    border-bottom: 2px solid var(--primary);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.user-badge {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid var(--card-border);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Dashboard Summary Cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.summary-card.primary::before { background: var(--primary); }
.summary-card.secondary::before { background: var(--secondary); }
.summary-card.success::before { background: var(--success); }
.summary-card.warning::before { background: var(--warning); }
.summary-card.info::before { background: var(--info); }

.card-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
    font-family: 'Montserrat', sans-serif;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Spreadsheet Tables View */
.spreadsheet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .spreadsheet-grid {
        grid-template-columns: 1fr;
    }
}

.table-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.table-title {
    font-size: 1.25rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Custom Styled Tables */
.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.custom-table th {
    background: rgba(255, 255, 255, 0.05);
    text-align: left;
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid var(--card-border);
}

.custom-table td {
    padding: 14px 16px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-main);
}

.custom-table tbody tr {
    transition: var(--transition);
}

.custom-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Nominal values alignment */
.col-nominal {
    text-align: right;
    font-family: monospace;
    font-size: 1.05rem !important;
}

/* Status Badges */
.badge {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-info { background: rgba(14, 165, 233, 0.15); color: var(--info); border: 1px solid rgba(14, 165, 233, 0.3); }
.badge-primary { background: rgba(99, 102, 241, 0.15); color: var(--primary); border: 1px solid rgba(99, 102, 241, 0.3); }

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px 0 var(--primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--modal-bg);
    border: 1px solid var(--card-border-focus);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-backdrop.open .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-main);
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }

/* Alerts */
.alert {
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    border-left: 4px solid transparent;
    font-size: 0.95rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: #a7f3d0;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: #fca5a5;
}

/* Login/Register Centered Layout */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 160px);
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Quick Period Selector Styles */
.period-selector {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.period-selector:focus {
    border-color: var(--primary);
}

/* Footer styling */
footer.app-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--card-border);
    margin-top: auto;
}

/* Visualization elements */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

/* Theme Switcher Toggle styling */
.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 8px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}
body.light-theme .theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.light-theme .theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Hamburger menu toggle button styling */
.menu-toggle-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 8px;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.menu-toggle-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.light-theme .menu-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

@media (max-width: 1024px) {
    .menu-toggle-btn {
        display: inline-flex;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        align-items: stretch;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--modal-bg);
        border-bottom: 1px solid var(--card-border);
        padding: 20px;
        gap: 12px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.15);
        z-index: 99;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    
    .nav-menu.open {
        display: flex;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-link {
        display: flex;
        align-items: center;
        padding: 10px 16px;
        width: 100%;
    }
    
    .period-selector {
        width: 100%;
    }
    
    .theme-toggle-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 10px 16px;
    }
}

/* PJAX Page Progress Bar */
#pjaxProgressBar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    z-index: 10000;
    width: 0;
    transition: width 0.4s ease, opacity 0.4s ease;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    opacity: 0;
    pointer-events: none;
}

/* Floating Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateY(20px);
    opacity: 0;
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
}

.toast-success {
    background: rgba(16, 185, 129, 0.95);
    border-left: 4px solid #10b981;
}

.toast-error {
    background: rgba(239, 68, 68, 0.95);
    border-left: 4px solid #ef4444;
}

.toast-info {
    background: rgba(14, 165, 233, 0.95);
    border-left: 4px solid #0ea5e9;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@keyframes toastSlideIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Button Loading Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Rupiah Input Styling */
.input-rupiah {
    font-family: 'Inter', monospace;
    font-weight: 600;
    color: var(--primary) !important;
}

