/* Custom Properties */
:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #818cf8;
  --secondary: #7c3aed;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --twk-color: #2563eb;
  --tiu-color: #7c3aed;
  --tkp-color: #059669;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom animations */
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 5px rgba(79, 70, 229, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.8);
  }
}

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

@keyframes slide-in-left {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-in-right {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fade-in-up {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulse-glow 2s infinite;
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
}

.animate-slide-left {
  animation: slide-in-left 0.6s ease-out;
}

.animate-slide-right {
  animation: slide-in-right 0.6s ease-out;
}

.animate-fade-up {
  animation: fade-in-up 0.6s ease-out;
}

/* Stagger animations */
.stagger-1 {
  animation-delay: 0.1s;
}
.stagger-2 {
  animation-delay: 0.2s;
}
.stagger-3 {
  animation-delay: 0.3s;
}
.stagger-4 {
  animation-delay: 0.4s;
}
.stagger-5 {
  animation-delay: 0.5s;
}

/* Category-specific styles */
.category-twk {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
}

.category-tiu {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: white;
}

.category-tkp {
  background: linear-gradient(135deg, #059669, #047857);
  color: white;
}

/* Glass morphism effect */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

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

/* Hover effects */
.hover-lift {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4f46e5, #7c3aed);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #3730a3, #6d28d9);
}

/* Timer styles */
.timer-urgent {
  animation: pulse 1s infinite;
  color: #ef4444 !important;
  font-weight: bold;
}

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

/* Question navigation */
.question-nav-item {
  transition: all 0.2s;
}

.question-nav-item:hover {
  transform: scale(1.1);
}

.question-nav-item.answered {
  background: linear-gradient(135deg, #10b981, #059669);
}

.question-nav-item.current {
  border: 3px solid #4f46e5;
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
  }
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Tambahkan di css/style.css */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e5e7eb;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Skeleton loading animation */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.animate-pulse .bg-gray-200 {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Gambar soal */
.exam-image {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.exam-image:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.exam-image.loaded {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Print/PDF Styles */
@media print {
  body {
    background: white !important;
  }
  .hidden {
    display: block !important;
  }
  button {
    display: none !important;
  }
  .print\:hidden {
    display: none !important;
  }
  .print\:block {
    display: block !important;
  }
  .print\:border {
    border: 1px solid #ddd !important;
  }
  .print\:shadow-none {
    box-shadow: none !important;
  }
  .print\:bg-white {
    background: white !important;
  }
  .print\:p-0 {
    padding: 0 !important;
  }
  .print\:p-4 {
    padding: 1rem !important;
  }
  .print\:rounded-lg {
    border-radius: 0.5rem !important;
  }

  @page {
    margin: 1.5cm;
    size: A4;
  }
}
