/* ============================================================
    ABSENSI ONLINE — Modern UI v3.0
    Super-modern employee design system
    ============================================================ */

:focus { outline: 0; }

::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 2px rgba(0,0,0,0.1); background-color: #ecf0f5; }
::-webkit-scrollbar { width: 6px; background-color: #ecf0f5; }
::-webkit-scrollbar-thumb { background-color: var(--color-gray-400); border-radius: 3px; }

/* ---- Gradient Backgrounds ---- */
.bg-gradient-primary { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.bg-gradient-success { background: linear-gradient(135deg, #10b981, #059669); }
.bg-gradient-danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.bg-gradient-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.bg-gradient-info { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.bg-gradient-dark { background: linear-gradient(135deg, #1e293b, #0f172a); }

/* ---- Glass Morphism Cards ---- */
.glass-card {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-lg);
}

/* ---- Modern Stat Cards ---- */
.stat-card-modern {
    background: var(--bg-card); border-radius: var(--border-radius-lg);
    padding: 16px 20px; box-shadow: var(--shadow);
    transition: all 200ms ease; border: 1px solid var(--border-color);
}
.stat-card-modern:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card-modern .stat-icon { width: 48px; height: 48px; border-radius: var(--border-radius); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 12px; }
.stat-card-modern .stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.stat-card-modern .stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }

/* ---- Attendance Cards ---- */
.attendance-card { background: var(--bg-card); border-radius: var(--border-radius-xl); overflow: hidden; box-shadow: var(--shadow-lg); margin-bottom: 20px; }
.attendance-card .att-header { background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary)); color: var(--text-on-primary); padding: 20px 24px; display: flex; align-items: center; gap: 12px; }
.attendance-card .att-header h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.attendance-card .att-body { padding: 24px; }
.attendance-card .time-display { text-align: center; padding: 16px 0; }
.attendance-card .time-display .time { font-size: 2.5rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.03em; }
.attendance-card .time-display .date { font-size: 0.9rem; color: var(--text-muted); margin-top: 4px; }

/* ---- Pulse Animation ---- */
@keyframes pulse-ring { 0% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.pulse-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; position: relative; }
.pulse-dot::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid currentColor; animation: pulse-ring 2s ease-out infinite; }
.pulse-dot.success { background: var(--color-success); color: var(--color-success); }
.pulse-dot.warning { background: var(--color-warning); color: var(--color-warning); }
.pulse-dot.danger { background: var(--color-danger); color: var(--color-danger); }

/* ---- Buttons ---- */
.btn-modern { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 24px; font-size: 0.95rem; font-weight: 600; border: none; border-radius: var(--border-radius); cursor: pointer; transition: all 200ms ease; font-family: var(--font-sans); box-shadow: var(--shadow); }
.btn-modern:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-modern:active { transform: translateY(0); }
.btn-modern:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-modern-primary { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); color: var(--text-on-primary); }
.btn-modern-success { background: linear-gradient(135deg, var(--color-success), #059669); color: #fff; }
.btn-modern-danger { background: linear-gradient(135deg, var(--color-danger), #dc2626); color: #fff; }
.btn-modern-warning { background: linear-gradient(135deg, var(--color-warning), #d97706); color: #fff; }
.btn-modern-outline { background: transparent; border: 2px solid var(--border-color); color: var(--text-secondary); box-shadow: none; }
.btn-modern-outline:hover { border-color: var(--color-primary); color: var(--color-primary); background: rgba(var(--color-primary-rgb),0.04); }

/* ---- ID Card ---- */
.id-card-modern { background: linear-gradient(145deg, #0f0c29, #302b63, #24243e); border-radius: var(--border-radius-xl); padding: 32px 24px; text-align: center; color: #fff; box-shadow: var(--shadow-xl); max-width: 360px; margin: 0 auto; position: relative; overflow: hidden; }
.id-card-modern::before { content: ''; position: absolute; top: -40%; left: -20%; width: 200px; height: 200px; background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%); border-radius: 50%; }
.id-card-modern .id-avatar { width: 88px; height: 88px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.3); object-fit: cover; margin-bottom: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.id-card-modern .id-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.id-card-modern .id-code { font-size: 0.85rem; opacity: 0.7; margin-bottom: 16px; }
.id-card-modern .id-barcode img { max-width: 140px; border-radius: 8px; background: #fff; padding: 6px; }

/* ---- Profile Hero ---- */
.profile-hero { text-align: center; padding: 24px 0; }
.profile-hero .avatar-wrapper { position: relative; display: inline-block; }
.profile-hero .avatar-wrapper img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 4px solid var(--bg-card); box-shadow: var(--shadow-lg); }

/* ---- Table Modern ---- */
.table-modern { width: 100%; border-collapse: collapse; }
.table-modern th { padding: 12px 10px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); text-align: left; border-bottom: 2px solid var(--border-color); }
.table-modern td { padding: 12px 10px; font-size: 0.875rem; border-bottom: 1px solid var(--color-gray-100); vertical-align: middle; }
.table-modern tr:last-child td { border-bottom: none; }
.table-modern tr:hover td { background: var(--color-gray-50); }

/* ---- Badges ---- */
.badge-modern { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--border-radius-full); font-size: 0.7rem; font-weight: 600; }
.badge-success { background: rgba(16,185,129,0.1); color: #059669; }
.badge-danger { background: rgba(239,68,68,0.1); color: #dc2626; }
.badge-warning { background: rgba(245,158,11,0.1); color: #d97706; }
.badge-info { background: rgba(6,182,212,0.1); color: #0891b2; }

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state ion-icon { font-size: 3rem; opacity: 0.3; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

/* ---- Animations ---- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
.anim-fade-up { animation: fadeInUp 0.5s ease forwards; }
.anim-slide-left { animation: slideInLeft 0.4s ease forwards; }
.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }

/* ---- Navigation ---- */
.navigation { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; background: rgba(255,255,255,0.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid rgba(0,0,0,0.06); box-shadow: 0 -4px 24px rgba(0,0,0,0.06); padding: 6px 0 env(safe-area-inset-bottom, 8px); }
.navigation ul { display: flex; list-style: none; margin: 0; padding: 0; justify-content: space-around; align-items: center; }
.navigation ul li { flex: 1; text-align: center; }
.navigation ul li a { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; text-decoration: none; color: var(--text-muted); font-size: 0.65rem; transition: all 200ms ease; gap: 3px; }
.navigation ul li a .icon { font-size: 1.35rem; }
.navigation ul li.active a, .navigation ul li a:hover { color: var(--color-primary); }

/* ---- Header ---- */
.appHeader { position: fixed; top: 0; left: 0; right: 0; z-index: 999; height: var(--header-height); background: rgba(255,255,255,0.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid rgba(0,0,0,0.06); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; box-shadow: 0 1px 8px rgba(0,0,0,0.04); }
.appHeader .left { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.appHeader .left img { width: 28px; height: 28px; border-radius: 6px; }
.appHeader .right { position: relative; }
.appHeader .right img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; cursor: pointer; }

/* ---- Sidebar ---- */
.panelbox .profileBox { background: linear-gradient(135deg, var(--color-primary), #7c3aed); color: #fff; padding: 24px 20px; text-align: center; }
.panelbox .profileBox img { width: 64px; height: 64px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.3); object-fit: cover; }
.panelbox .profileBox .in { margin-top: 10px; }
.panelbox .profileBox .in strong { font-size: 0.95rem; }
.panelbox .profileBox .in .text-muted { color: rgba(255,255,255,0.7) !important; }

/* ---- Webcam Button ---- */
.btn-webcam-capture { width: 100%; padding: 16px; font-size: 1rem; font-weight: 700; border: none; border-radius: var(--border-radius); cursor: pointer; transition: all 200ms ease; display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--font-sans); color: #fff; margin-top: 16px; box-shadow: var(--shadow-md); }
.btn-webcam-capture:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-webcam-capture.btn-in { background: linear-gradient(135deg, #10b981, #059669); }
.btn-webcam-capture.btn-out { background: linear-gradient(135deg, #ef4444, #dc2626); }
.btn-webcam-capture:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ---- Form ---- */
.form-control-modern { width: 100%; height: 50px; padding: 12px 16px; font-size: 0.95rem; font-family: var(--font-sans); border: 1.5px solid var(--border-color); border-radius: var(--border-radius); background: var(--bg-card); color: var(--text-primary); transition: all 200ms ease; }
.form-control-modern:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1); outline: none; }
.form-control-modern:disabled { background: var(--color-gray-100); color: var(--text-muted); }

/* ---- Section Title ---- */
.section-title-modern { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 12px; padding: 0 4px; }

/* ---- Webcam / DataTable / Magnific / Wallet ---- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.webcam-capture, .webcam-capture video { width: 100% !important; max-width: 100% !important; height: auto !important; border-radius: var(--border-radius-lg); overflow: hidden; background: #111; box-shadow: var(--shadow-md); }
.wallet-card .wallet-footer .webcame, .webcam-capture-body { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 0; }
.wallet-card .wallet-footer .webcame canvas, .webcam-capture-body canvas { width: 100%; max-width: 480px; border-radius: var(--border-radius); overflow: hidden; }
.webcam-card { background: var(--bg-card); border-radius: var(--border-radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; margin: 16px 0; }
.webcam-card .webcam-header { background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary)); color: var(--text-on-primary); padding: 16px 20px; font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.webcam-card .webcam-body { padding: 16px; }
.wallet-card-section, .webcam-section { background: var(--bg-card); border-radius: var(--border-radius); padding: 8px 16px; width: 100%; box-sizing: border-box; box-shadow: var(--shadow); margin-bottom: 16px; }
.bolded { font-weight: 700; margin-bottom: 8px; }
.pengumuman-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 16px; margin-bottom: 16px; }
.pengumuman-card h4 { font-weight: 700; margin-bottom: 4px; }
.action-sheet .modal-dialog { border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0; }
.action-sheet-content { padding: 8px 0; }
.gy-5 > [class*='col'] { margin-bottom: 24px; }
.image-link { cursor: pointer; }
.mfp-bg { background: var(--bg-overlay); }
.mfp-close { color: var(--text-on-primary) !important; font-size: 2rem !important; }

/* ---- DataTables ---- */
div.dataTables_filter { text-align: right; margin-bottom: 12px; }
div.dataTables_filter label { font-weight: 500; font-size: 0.875rem; }
div.dataTables_filter input { margin-left: 8px; padding: 8px 12px; border: 1.5px solid var(--border-color); border-radius: var(--border-radius-sm); font-size: 0.875rem; }
div.dataTables_filter input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1); outline: none; }
div.dataTables_info { padding-top: 8px; font-size: 0.8rem; color: var(--text-muted); }
div.dataTables_paginate { float: right; margin-top: 8px; }
.pagination { display: flex; list-style: none; gap: 2px; }
.pagination > li > a, .pagination > li > span { padding: 6px 12px; font-size: 0.8rem; color: var(--text-primary); background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); text-decoration: none; transition: background 150ms; }
.pagination > li > a:hover { background: var(--color-gray-100); }
.pagination > .active > a { background: var(--color-primary); color: var(--text-on-primary); border-color: var(--color-primary); }
