/* assets/css/style.css - Modern Responsive Glassmorphism Design */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css');

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #e0e7ff;
  --secondary: #64748b;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #06b6d4;
  --info-light: #cffaff;

  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  --sidebar-width: 260px;
  --topbar-height: 70px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 25px rgba(79, 70, 229, 0.25);
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Layout Wrapper */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background: #0f172a;
  color: #f8fafc;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.8);
}

.brand-title {
  font-weight: 700;
  font-size: 1.2rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #4f46e5, #818cf8);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.sidebar-menu {
  padding: 1.5rem 1rem;
  list-style: none;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto;
}

.menu-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  margin: 1.25rem 0 0.5rem 0.75rem;
  letter-spacing: 0.05em;
}

.menu-item {
  margin-bottom: 0.35rem;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: #94a3b8;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all 0.2s ease;
}

.menu-link i {
  font-size: 1.2rem;
}

.menu-link:hover, .menu-item.active .menu-link {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.25) 0%, rgba(79, 70, 229, 0.05) 100%);
  border-left: 3px solid var(--primary);
}

/* Main Body Area */
.app-main {
  flex-grow: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: all 0.3s ease;
}

/* Topbar */
.app-topbar {
  height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 990;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-main);
  border-radius: 30px;
  border: 1px solid var(--border-color);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Content Container */
.app-content {
  padding: 2rem;
  flex-grow: 1;
}

/* Cards & Glassmorphism */
.card-custom {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.card-custom:hover {
  box-shadow: 0 15px 30px -10px rgba(0,0,0,0.1);
}

/* Stat Cards */
.stat-card {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-right: 1.25rem;
  flex-shrink: 0;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* QR Code Scanner Overlay Styling */
.scanner-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

#reader {
  width: 100% !important;
  border-radius: var(--radius-lg);
  overflow: hidden !important;
  border: 2px solid var(--primary);
  background: #0f172a;
}

#reader video {
  width: 100% !important;
  height: auto !important;
  max-height: 480px !important;
  border-radius: var(--radius-lg);
  object-fit: contain !important;
  display: block;
}

/* Scanner Animation Laser */
.scan-laser {
  position: absolute;
  top: 10%;
  left: 5%;
  right: 5%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #ef4444, transparent);
  box-shadow: 0 0 15px #ef4444;
  animation: scanAnim 2s infinite ease-in-out;
  pointer-events: none;
  z-index: 10;
}

@keyframes scanAnim {
  0% { top: 10%; opacity: 0.3; }
  50% { top: 85%; opacity: 1; }
  100% { top: 10%; opacity: 0.3; }
}

/* Modal Scan Result Card */
.scan-result-card {
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Print Kartu Pelajar Styles */
.kartu-pelajar {
  width: 320px;
  height: 200px;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #fff;
  border-radius: 12px;
  padding: 15px;
  position: relative;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  margin: 10px auto;
  font-size: 0.8rem;
  overflow: hidden;
}

.kartu-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 6px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.kartu-body {
  display: flex;
  gap: 12px;
  align-items: center;
}

.kartu-foto {
  width: 65px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid #fff;
  background: #e2e8f0;
}

.kartu-qr {
  width: 65px;
  height: 65px;
  background: #fff;
  padding: 4px;
  border-radius: 6px;
  margin-left: auto;
}

/* Print Rules */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .app-sidebar, .app-topbar, .btn-print-hide {
    display: none !important;
  }
  .app-main {
    margin-left: 0 !important;
  }
  .app-content {
    padding: 0 !important;
  }
  .kartu-pelajar {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
  }
}

/* Responsive Mobile Sidebar Toggle */
@media (max-width: 991px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
  .app-main {
    margin-left: 0;
  }
  .app-topbar {
    padding: 0 1rem;
  }
}
