/* LogiHR v2.0 - Custom CSS */
/* Tailwind CSS via CDN — @apply TIDAK berfungsi di CDN, gunakan CSS biasa */

:root {
  --color-primary: #4F46E5;
  --color-primary-dark: #3730A3;
  --color-sidebar: #0F172A;
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger:  #F43F5E;
}

/* Smooth page transitions */
.page-content {
  animation: fadeIn 0.2s ease-in-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Sidebar */
.sidebar {
  background-color: var(--color-sidebar);
  transition: width 0.3s ease, transform 0.3s ease;
}
.sidebar-item.active {
  background-color: rgba(79, 70, 229, 0.15);
  border-left: 3px solid var(--color-primary);
  color: #818CF8;
}
.sidebar-item:hover:not(.active) {
  background-color: rgba(255,255,255,0.06);
}

/* QR Code Container */
.qr-container {
  border: 3px solid var(--color-success);
  border-radius: 16px;
  padding: 16px;
  display: inline-block;
  background: white;
  animation: qrPulse 2s ease-in-out infinite;
}
@keyframes qrPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.3); }
  50%       { box-shadow: 0 0 0 12px rgba(16,185,129,0); }
}

/* Status Badges */
.badge-hadir     { background:#d1fae5; color:#065f46; font-size:0.75rem; font-weight:700; padding:2px 10px; border-radius:999px; }
.badge-terlambat { background:#fef3c7; color:#92400e; font-size:0.75rem; font-weight:700; padding:2px 10px; border-radius:999px; }
.badge-alpha     { background:#ffe4e6; color:#9f1239; font-size:0.75rem; font-weight:700; padding:2px 10px; border-radius:999px; }
.badge-cuti      { background:#dbeafe; color:#1e40af; font-size:0.75rem; font-weight:700; padding:2px 10px; border-radius:999px; }
.badge-izin      { background:#ede9fe; color:#5b21b6; font-size:0.75rem; font-weight:700; padding:2px 10px; border-radius:999px; }
.badge-off       { background:#f1f5f9; color:#475569; font-size:0.75rem; font-weight:700; padding:2px 10px; border-radius:999px; }

/* Cards */
.stat-card {
  background: white;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #f1f5f9;
  transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

/* Tables */
.data-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  text-align: left;
}
.data-table td {
  padding: 12px 16px;
  font-size: 0.875rem;
  color: #334155;
  border-top: 1px solid #f8fafc;
}
.data-table tr:hover td { background: rgba(248,250,252,0.5); }

/* Toast Notifications */
.toast {
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; pointer-events: none; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ============================================
   MOBILE BOTTOM NAV — WAJIB FULL CSS (bukan @apply)
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  padding: 6px 8px;
  z-index: 50;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
  /* Aman untuk iPhone notch */
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border-radius: 12px;
  transition: all 0.15s;
  text-decoration: none;
  color: #64748b;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item.active {
  color: #4F46E5;
}
.bottom-nav-item svg {
  width: 22px;
  height: 22px;
}
.bottom-nav-item span {
  font-size: 10px;
  font-weight: 500;
}

/* Hide bottom nav on desktop */
@media (min-width: 1024px) {
  .bottom-nav { display: none !important; }
}

/* Loading skeleton */
.skeleton {
  background: #e2e8f0;
  border-radius: 0.25rem;
  animation: pulse 2s cubic-bezier(0.4,0,0.6,1) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* Print styles */
@media print {
  .sidebar, .bottom-nav, header, .no-print { display: none !important; }
  .page-content { margin: 0 !important; padding: 0 !important; }
}
/* Main content jangan tertutup bottom nav di mobile */
@media (max-width: 1023px) {
  main, .page-content, #main-content {
    padding-bottom: 80px !important;
  }
}