/* MTS PUTRI AT-TAHZIB KEKAIT - Custom Styles */

:root {
  --emerald: #10b981;
  --emerald-dark: #047857;
  --gold: #f59e0b;
  --gold-dark: #b45309;
}

* {
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Glassmorphism */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

.dark .glass {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(75, 85, 99, 0.3);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Islamic Pattern Background */
.islamic-pattern {
  background-color: #ecfdf5;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%2310b981' fill-opacity='0.05'%3E%3Cpath d='M40 0L46 12L60 14L50 24L52 38L40 32L28 38L30 24L20 14L34 12z'/%3E%3C/g%3E%3C/svg%3E");
}

.dark .islamic-pattern {
  background-color: #022c22;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(245, 158, 11, 0.10) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%2310b981' fill-opacity='0.1'%3E%3Cpath d='M40 0L46 12L60 14L50 24L52 38L40 32L28 38L30 24L20 14L34 12z'/%3E%3C/g%3E%3C/svg%3E");
}

/* Gradient Backgrounds */
.bg-gradient-emerald {
  background: linear-gradient(135deg, #10b981 0%, #047857 50%, #065f46 100%);
}

.bg-gradient-gold {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
}

.bg-mesh {
  background-color: #ecfdf5;
  background-image:
    radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.3) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(245, 158, 11, 0.2) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 95, 70, 0.2) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(251, 191, 36, 0.2) 0px, transparent 50%);
}

.dark .bg-mesh {
  background-color: #022c22;
  background-image:
    radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.3) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(245, 158, 11, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 95, 70, 0.3) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(251, 191, 36, 0.1) 0px, transparent 50%);
}

/* Animated Gradient Text */
.text-gradient {
  background: linear-gradient(135deg, #10b981 0%, #f59e0b 50%, #10b981 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient 4s ease infinite;
}

@keyframes gradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Smooth scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #10b981; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #047857; }
.dark ::-webkit-scrollbar-thumb { background: #047857; }

/* Card hover effects */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -10px rgba(16, 185, 129, 0.3);
}

/* Button shine effect */
.btn-shine {
  position: relative;
  overflow: hidden;
}
.btn-shine::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.6s;
}
.btn-shine:hover::before { left: 100%; }

/* Loader */
.loader {
  border: 3px solid rgba(16, 185, 129, 0.2);
  border-top-color: #10b981;
  border-radius: 50%;
  width: 24px; height: 24px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sidebar */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  color: #6b7280;
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
}
.sidebar-link:hover {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}
.sidebar-link.active {
  background: linear-gradient(135deg, #10b981, #047857);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.dark .sidebar-link { color: #9ca3af; }
.dark .sidebar-link:hover { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }

/* Status pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.pill-success { background: #d1fae5; color: #065f46; }
.pill-warning { background: #fef3c7; color: #92400e; }
.pill-danger { background: #fee2e2; color: #991b1b; }
.pill-info { background: #dbeafe; color: #1e40af; }

.dark .pill-success { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.dark .pill-warning { background: rgba(245,158,11,0.2); color: #fcd34d; }
.dark .pill-danger { background: rgba(239,68,68,0.2); color: #fca5a5; }
.dark .pill-info { background: rgba(59,130,246,0.2); color: #93c5fd; }

/* Exam UI specific */
.exam-camera-overlay {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 200px;
  height: 150px;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid #10b981;
  box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4);
  z-index: 9999;
}

.exam-camera-overlay video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.violation-flash {
  animation: flash 0.5s;
}
@keyframes flash {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(239, 68, 68, 0.3); }
}

/* Question card */
.question-card {
  border-left: 4px solid transparent;
  transition: all 0.2s;
}
.question-card.answered { border-left-color: #10b981; }
.question-card.current { border-left-color: #f59e0b; }

/* Floating particles */
.particles {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.particle {
  position: absolute;
  background: radial-gradient(circle, rgba(16,185,129,0.5) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 8s infinite ease-in-out;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  50% { transform: translate(30px, -30px) scale(1.2); opacity: 0.8; }
}

/* Marquee for stats */
.marquee {
  display: flex;
  overflow: hidden;
  white-space: nowrap;
}
.marquee-content {
  display: inline-flex;
  animation: marquee 30s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Print styles */
@media print {
  .no-print { display: none !important; }
}

/* Mobile bottom nav */
.bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    border-top: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    z-index: 50;
    justify-content: space-around;
    padding: 0.5rem;
  }
  .dark .bottom-nav { background: #111827; border-top-color: rgba(16,185,129,0.3); }
  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    color: #6b7280;
    font-size: 0.7rem;
  }
  .bottom-nav-item.active { color: #10b981; }
}

/* Notification badge */
.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Quiz timer */
.timer-warning {
  animation: pulse-red 1s ease-in-out infinite;
  color: #ef4444 !important;
}
@keyframes pulse-red {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Login animated bg */
.login-bg {
  background: linear-gradient(-45deg, #047857, #10b981, #f59e0b, #d97706);
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  background: white;
  border-left: 4px solid #10b981;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease-out;
  max-width: 400px;
}
.toast.error { border-left-color: #ef4444; }
.toast.warning { border-left-color: #f59e0b; }
.dark .toast { background: #1f2937; color: white; }

@keyframes slideIn {
  from { transform: translateX(120%); }
  to { transform: translateX(0); }
}

/* Calendar grid */
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.cal-day:hover { background: rgba(16,185,129,0.1); }
.cal-day.active { background: #10b981; color: white; }
.cal-day.has-event { position: relative; }
.cal-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #f59e0b;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
.dark .skeleton {
  background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
  background-size: 200% 100%;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============= DYNAMIC UI ENHANCEMENTS ============= */

/* Ripple effect */
.btn-ripple, .ripple { position: relative; overflow: hidden; }
.ripple-ink {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  transform: translate(-50%,-50%) scale(0);
  animation: ripple-anim 0.7s ease-out;
  pointer-events: none;
}
@keyframes ripple-anim {
  to { transform: translate(-50%,-50%) scale(40); opacity: 0; }
}

/* Page enter animation */
.page-enter { opacity: 0; transform: translateY(8px); }
.page-enter-active {
  opacity: 1; transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Card hover lift */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -10px rgba(16,185,129,0.25);
}

/* Stat card with shine */
.stat-card {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.6s;
}
.stat-card:hover::before { left: 100%; }
.stat-card:hover { transform: translateY(-3px) scale(1.02); }

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 10px 25px -5px rgba(16,185,129,0.5);
  cursor: pointer;
  z-index: 50;
  transition: all 0.3s;
  border: none;
}
.fab:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 15px 35px -5px rgba(16,185,129,0.7);
}
.fab.fab-gold { background: linear-gradient(135deg, #fbbf24, #d97706); box-shadow: 0 10px 25px -5px rgba(217,119,6,0.5); }
@media (max-width: 768px) { .fab { bottom: 80px; } }

/* Smooth table row */
.tr-anim { transition: all 0.2s ease; }
.tr-anim:hover {
  transform: translateX(4px);
  box-shadow: -4px 0 0 0 #10b981;
}

/* Skeleton variants */
.skeleton-text { height: 14px; margin: 6px 0; }
.skeleton-title { height: 24px; width: 60%; margin: 8px 0; }
.skeleton-circle { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-block { height: 100px; width: 100%; }
.skeleton-row { height: 48px; margin-bottom: 8px; }

/* Modal animations */
.modal-overlay { animation: fadeIn 0.25s ease; }
.modal-content { animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Interactive form input */
.input-glow:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(16,185,129,0.15);
  border-color: #10b981;
}

/* Progress ring */
.progress-ring { transform: rotate(-90deg); }
.progress-ring circle {
  transition: stroke-dashoffset 0.6s ease;
}

/* Dynamic gradient backgrounds for stat cards */
.bg-stat-1 { background: linear-gradient(135deg, #10b981, #059669); }
.bg-stat-2 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.bg-stat-3 { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.bg-stat-4 { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.bg-stat-5 { background: linear-gradient(135deg, #ec4899, #db2777); }
.bg-stat-6 { background: linear-gradient(135deg, #ef4444, #dc2626); }

/* Bounce in for list items */
.list-stagger > * {
  animation: slideUp 0.4s ease backwards;
}
.list-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.list-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.list-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.list-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.list-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.list-stagger > *:nth-child(6) { animation-delay: 0.3s; }
.list-stagger > *:nth-child(7) { animation-delay: 0.35s; }
.list-stagger > *:nth-child(8) { animation-delay: 0.4s; }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tab nav */
.tabs-pill {
  display: inline-flex; gap: 4px; padding: 4px;
  background: rgba(0,0,0,0.05); border-radius: 12px;
}
.dark .tabs-pill { background: rgba(255,255,255,0.05); }
.tab-btn {
  padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  transition: all 0.2s;
  cursor: pointer; border: none;
  background: transparent; color: inherit;
}
.tab-btn.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 10px -2px rgba(16,185,129,0.4);
}

/* Pulse dot for live indicator */
.live-dot {
  position: relative; display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444;
}
.live-dot::after {
  content: ''; position: absolute;
  inset: -4px; border-radius: 50%;
  border: 2px solid #ef4444;
  animation: live-pulse 1.5s infinite;
}
@keyframes live-pulse {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

/* Stat number large */
.stat-num {
  font-size: 2rem; font-weight: 800;
  background: linear-gradient(135deg, #fff, #d1fae5);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Drag-drop area */
.dropzone {
  border: 2px dashed #d1d5db;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragover {
  border-color: #10b981;
  background: rgba(16,185,129,0.05);
}

