/* Modern Custom Styling for Cybernetics ODL Centre with Windows Explorer Style Sidebar */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary-navy: #0f172a;
  --primary-blue: #0284c7;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --bg-slate: #f8fafc;
  --sidebar-bg: #ffffff;
  --border-slate: #e2e8f0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-slate);
  color: #334155;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f8fafc;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Glassmorphism & Header */
.glass-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

/* Windows Explorer Tree Directory Styling */
.tree-node {
  position: relative;
  transition: all 0.15s ease-in-out;
}

.tree-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  transition: all 0.15s ease;
  text-align: left;
}

.tree-item-btn:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.tree-item-btn.active {
  background-color: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
}

.tree-sub-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 32px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  transition: all 0.15s ease;
  position: relative;
}

.tree-sub-item-btn::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 8px;
  height: 1px;
  background-color: #cbd5e1;
}

.tree-sub-item-btn:hover {
  background-color: #f8fafc;
  color: #0f172a;
}

.tree-sub-item-btn.active {
  background-color: #f0fdf4;
  color: #15803d;
  font-weight: 700;
}

.tree-sub-item-btn.active::before {
  background-color: #16a34a;
  height: 2px;
}

/* Card Hover Animations */
.resource-card {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid #e2e8f0;
}

.resource-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(15, 23, 42, 0.07), 0 4px 6px -2px rgba(15, 23, 42, 0.02);
  border-color: #cbd5e1;
}

/* List Row View (Windows Explorer List Mode) */
.resource-row {
  transition: all 0.15s ease;
  border-bottom: 1px solid #f1f5f9;
}
.resource-row:hover {
  background-color: #f8fafc;
}

/* View Mode Switcher Active */
.view-btn.active {
  background-color: #0f172a;
  color: #ffffff;
}

/* Admin Glowing Pulse */
.admin-badge-pulse {
  box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7);
  animation: pulse-ring 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulse-ring {
  to {
    box-shadow: 0 0 0 8px rgba(14, 165, 233, 0);
  }
}

/* Modal Backdrop Blur */
.modal-backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Toast Styling */
.toast-item {
  animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   PORTAL GATEKEEPER - DARK ROOM DESK LAMP THEME
   ========================================================================== */

.gatekeeper-screen {
  background-color: #060911;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(30, 58, 138, 0.2), transparent),
    radial-gradient(circle at 50% 120%, rgba(15, 23, 42, 0.8), #030712);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Meja Kayu di bahagian bawah (Wooden Desk Surface) */
.desk-surface {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38%;
  background: linear-gradient(180deg, #1c130c 0%, #120b06 45%, #080503 100%);
  border-top: 2px solid rgba(217, 119, 6, 0.25);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.9);
  z-index: 1;
}

.desk-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 60px,
    rgba(0, 0, 0, 0.04) 60px,
    rgba(0, 0, 0, 0.04) 120px
  );
  opacity: 0.7;
}

/* Pantulan Cahaya di atas meja (Desk Light Pool) */
.desk-light-pool {
  position: absolute;
  top: -15%;
  left: 50%;
  transform: translateX(-50%);
  width: 650px;
  max-width: 90vw;
  height: 240px;
  background: radial-gradient(ellipse at center, rgba(254, 240, 138, 0.25) 0%, rgba(245, 158, 11, 0.12) 40%, rgba(217, 119, 6, 0.03) 70%, transparent 85%);
  border-radius: 50%;
  pointer-events: none;
  filter: blur(12px);
  z-index: 2;
}

/* Lampu Meja & Kon Cahaya (Desk Lamp Light Beam) */
.lamp-container {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Kon Sinaran Cahaya Lampu (Volumetric Light Cone) */
.lamp-light-beam {
  position: absolute;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  width: 640px;
  max-width: 95vw;
  height: 520px;
  background: linear-gradient(
    180deg,
    rgba(254, 243, 199, 0.35) 0%,
    rgba(253, 230, 138, 0.18) 35%,
    rgba(245, 158, 11, 0.08) 70%,
    transparent 100%
  );
  clip-path: polygon(46% 0%, 54% 0%, 100% 100%, 0% 100%);
  filter: blur(1px);
  pointer-events: none;
  z-index: 3;
}

/* Kad Terapung di Kawasan Suluhan Lampu (Floating Illuminated Card) */
.floating-gatekeeper-card {
  position: relative;
  z-index: 20;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(251, 191, 36, 0.35);
  box-shadow: 
    0 0 45px rgba(245, 158, 11, 0.18),
    0 25px 50px -12px rgba(0, 0, 0, 0.85);
  transition: all 0.3s ease;
}

.floating-gatekeeper-card:hover {
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 
    0 0 55px rgba(245, 158, 11, 0.25),
    0 30px 60px -12px rgba(0, 0, 0, 0.9);
}

/* Suis Pilihan Fizikal / Dwi-Peranan (Tactile Toggle Switch) */
.role-switch-container {
  background: rgba(2, 6, 23, 0.75);
  border: 1px solid rgba(51, 65, 85, 0.8);
  padding: 4px;
  border-radius: 16px;
  display: flex;
  position: relative;
}

.role-switch-btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
  color: #94a3b8;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.role-switch-btn:hover {
  color: #f8fafc;
}

.role-switch-btn.active {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.4);
}

/* Kotak Input Bercahaya (Glowing Input) */
.gatekeeper-input {
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(71, 85, 105, 0.8);
  color: #f8fafc;
  transition: all 0.2s ease;
}

.gatekeeper-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
  outline: none;
}

/* Animasi Goncang jika salah kata laluan */
@keyframes shakeHorizontal {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.shake-error {
  animation: shakeHorizontal 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
