/* ========================================================
   GLOBAL DESIGN SYSTEM - ABSENSI QR
   ======================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    --navbar-bg: rgba(255, 255, 255, 0.9);
}

[data-bs-theme="dark"] {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    
    --navbar-bg: rgba(30, 41, 59, 0.9);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* ========================================================
   CARDS & CONTAINERS
   ======================================================== */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card {
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    border: none;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

/* ========================================================
   NAVIGATION
   ======================================================== */
.navbar {
    background: var(--navbar-bg) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 1050;
}

.navbar-brand {
    color: var(--primary-color) !important;
    font-weight: 700;
    font-size: 1.25rem;
}

.navbar-nav .nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
}

.navbar-nav .nav-link:hover, .navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
    background-color: rgba(79, 70, 229, 0.05);
}

/* ========================================================
   BUTTONS
   ======================================================== */
.btn {
    font-weight: 600;
    border-radius: 9999px; /* Pill shape by default */
    padding: 0.5rem 1.5rem;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.4);
}

.btn-danger { background-color: var(--danger-color); box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3); }
.btn-danger:hover { background-color: #dc2626; transform: translateY(-2px); box-shadow: 0 6px 8px -1px rgba(239, 68, 68, 0.4); }

.btn-success { background-color: var(--success-color); box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3); }
.btn-success:hover { background-color: #059669; transform: translateY(-2px); box-shadow: 0 6px 8px -1px rgba(16, 185, 129, 0.4); }

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* ========================================================
   TABLES
   ======================================================== */
.table {
    border-collapse: separate;
    border-spacing: 0;
}
.table thead th {
    background-color: var(--bg-color);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
    padding: 1rem;
}
.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}
.table-hover tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.02);
}

/* ========================================================
   STICKY COLUMNS & DARK MODE TABLE SYNCHRONIZATION
   ======================================================== */
.sticky-col-3 {
    position: sticky;
    left: 0;
    min-width: 200px;
    background-color: var(--card-bg, #fff);
    z-index: 5;
    box-shadow: 3px 0 5px rgba(0, 0, 0, 0.08);
}
th.sticky-col-3 {
    background-color: var(--bg-color, #f8f9fa) !important;
    color: var(--text-muted);
    z-index: 10;
}
.table-hover tbody tr:hover td.sticky-col-3 {
    background-color: #f2f4f7 !important;
}

/* Dark mode overrides for tables, rows, badges & sticky columns */
[data-bs-theme="dark"] .table,
[data-bs-theme="dark"] .table-prota,
[data-bs-theme="dark"] .table-promes,
[data-bs-theme="dark"] .table > :not(caption) > * > * {
    --bs-table-bg: transparent !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03) !important;
    --bs-table-hover-bg: rgba(99, 102, 241, 0.15) !important;
    --bs-table-color: #f8f9fa !important;
    background-color: transparent !important;
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .table tbody tr,
[data-bs-theme="dark"] .table tbody tr:nth-of-type(odd),
[data-bs-theme="dark"] .table tbody tr:nth-of-type(even),
[data-bs-theme="dark"] .table tbody td,
[data-bs-theme="dark"] .table tbody th,
[data-bs-theme="dark"] .table-prota tbody tr,
[data-bs-theme="dark"] .table-prota tbody td,
[data-bs-theme="dark"] .table-promes tbody tr,
[data-bs-theme="dark"] .table-promes tbody td {
    background-color: transparent !important;
    color: #f8f9fa !important;
    border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .sticky-col-3,
[data-bs-theme="dark"] .sticky-left-1,
[data-bs-theme="dark"] .sticky-left-2,
[data-bs-theme="dark"] .sticky-left-3,
[data-bs-theme="dark"] .sticky-left-first,
[data-bs-theme="dark"] .table tbody td.sticky-col-3,
[data-bs-theme="dark"] .table tbody td.sticky-left-1,
[data-bs-theme="dark"] .table tbody td.sticky-left-2,
[data-bs-theme="dark"] .table tbody td.sticky-left-3,
[data-bs-theme="dark"] .table tbody td.sticky-left-first,
[data-bs-theme="dark"] .table-prota tbody td.sticky-col-3,
[data-bs-theme="dark"] .table-promes tbody td.sticky-left-1,
[data-bs-theme="dark"] .table-promes tbody td.sticky-left-2,
[data-bs-theme="dark"] .table-promes tbody td.sticky-left-3,
[data-bs-theme="dark"] .table-promes tbody td.sticky-left-first {
    background-color: #1e293b !important;
    color: #f8f9fa !important;
    box-shadow: 3px 0 5px rgba(0, 0, 0, 0.3);
    z-index: 5;
    opacity: 1 !important;
}

[data-bs-theme="dark"] th.sticky-col-3,
[data-bs-theme="dark"] th.sticky-left-1,
[data-bs-theme="dark"] th.sticky-left-2,
[data-bs-theme="dark"] th.sticky-left-3,
[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-light th,
[data-bs-theme="dark"] .table-light td,
[data-bs-theme="dark"] .table-matrix th,
[data-bs-theme="dark"] .table-custom th {
    background-color: var(--bg-color) !important;
    color: var(--text-muted) !important;
    border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .table-hover tbody tr:hover td.sticky-col-3,
[data-bs-theme="dark"] .table-hover tbody tr:hover td.sticky-left-1,
[data-bs-theme="dark"] .table-hover tbody tr:hover td.sticky-left-2,
[data-bs-theme="dark"] .table-hover tbody tr:hover td.sticky-left-3 {
    background-color: #263347 !important;
    color: var(--text-main) !important;
}

[data-bs-theme="dark"] .table-hover tbody tr:hover,
[data-bs-theme="dark"] .table-hover tbody tr:hover td,
[data-bs-theme="dark"] .table-hover tbody tr:hover th {
    background-color: rgba(99, 102, 241, 0.15) !important;
    color: #ffffff !important;
}

/* Fix bg-light and badges in dark mode */
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .badge.bg-light {
    background-color: #334155 !important;
    color: #f8f9fa !important;
    border-color: #475569 !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .badge.bg-primary-subtle {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

[data-bs-theme="dark"] .badge.bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #6ee7b7 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

/* ========================================================
   BADGES & UTILITIES
   ======================================================== */
.badge {
    padding: 0.4em 0.8em;
    font-weight: 600;
    border-radius: var(--radius-md);
}
.badge.bg-success { background-color: rgba(16, 185, 129, 0.1) !important; color: var(--success-color); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge.bg-danger { background-color: rgba(239, 68, 68, 0.1) !important; color: var(--danger-color); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge.bg-warning { background-color: rgba(245, 158, 11, 0.1) !important; color: #b45309; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge.bg-secondary { background-color: rgba(100, 116, 139, 0.1) !important; color: var(--text-muted); border: 1px solid rgba(100, 116, 139, 0.2); }

/* Custom Inputs */
.form-control, .form-select {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    transition: all 0.2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.animate-fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Glassmorphism utility */
.glass {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent !important;
    z-index: 1;
}
.glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: inherit;
}


/* Dropdown Menu Background Fix */
.dropdown-menu {
    background-color: var(--card-bg);
}

/* Ensure text in card-header matches table */
.card-header h4, .card-header h5, .card-header h6, th, td {
    font-size: 0.95rem !important;
}

/* Dark mode overrides for Bootstrap components */
[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}
[data-bs-theme="dark"] .dropdown-item {
    color: var(--text-main);
}
[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}
[data-bs-theme="dark"] .form-control, 
[data-bs-theme="dark"] .form-select, 
[data-bs-theme="dark"] .input-group-text {
    background-color: var(--bg-color);
    color: var(--text-main);
    border-color: var(--border-color);
}
[data-bs-theme="dark"] .form-control::placeholder {
    color: var(--text-muted);
}
[data-bs-theme="dark"] .bg-light {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}
[data-bs-theme="dark"] .bg-white {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
}

/* ========================================================
   DEVELOPER CREDIT & FOOTER STYLES
   ======================================================== */
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.25); }
    30% { transform: scale(1); }
    45% { transform: scale(1.25); }
    60% { transform: scale(1); }
}

.animate-heartbeat {
    display: inline-block;
    animation: heartbeat 2s infinite;
}

.footer-credit {
    border-top: 1px solid var(--border-color);
    background: var(--navbar-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.developer-badge-btn {
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.2);
    color: var(--primary-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.developer-badge-btn:hover {
    background: var(--primary-color);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

[data-bs-theme="dark"] .developer-badge-btn {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #818cf8;
}

[data-bs-theme="dark"] .developer-badge-btn:hover {
    background: #6366f1;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.developer-hero-banner {
    height: 135px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
    position: relative;
    overflow: hidden;
}

.developer-hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
}

.developer-hero-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 10%;
    width: 140px;
    height: 140px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.developer-avatar-wrapper {
    width: 86px;
    height: 86px;
    margin-top: -43px;
    position: relative;
    z-index: 2;
    border: 4px solid var(--card-bg);
    box-shadow: 0 8px 20px -4px rgba(79, 70, 229, 0.35);
    background: linear-gradient(135deg, #4f46e5, #9333ea);
    transition: transform 0.3s ease;
}

.developer-avatar-wrapper:hover {
    transform: rotate(5deg) scale(1.05);
}

/* ========================================================
   TABLE INPUT NILAI ADJUSTMENTS (DAFTAR NILAI)
   ======================================================== */
#tabelNilai th,
#tabelNilai td {
    white-space: nowrap;
}

.tp-input, .sas-input, .rata-tp, .nilai-akhir {
    min-width: 75px !important;
    padding-left: 0.35rem !important;
    padding-right: 0.35rem !important;
    font-size: 0.9rem !important;
}

#tabelNilai,
#tabelNilai thead tr:first-child th {
    border-top: 1px solid var(--border-color) !important;
}

/* ========================================================
   DARK MODE BUTTON VISIBILITY FIXES
   ======================================================== */
[data-bs-theme="dark"] .btn-outline-dark {
    color: #f8f9fa !important;
    border-color: #6c757d !important;
}
[data-bs-theme="dark"] .btn-outline-dark:hover,
[data-bs-theme="dark"] .btn-outline-dark:focus {
    background-color: #495057 !important;
    color: #ffffff !important;
    border-color: #f8f9fa !important;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    color: #e2e8f0 !important;
    border-color: #64748b !important;
}
[data-bs-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-secondary:focus {
    background-color: #475569 !important;
    color: #ffffff !important;
    border-color: #94a3b8 !important;
}



