/* ==========================================================================
   Shima Smart Exam - Custom Stylesheet
   Design System: Academic Integrity System
   ========================================================================== */

/* Custom Variables & Root Settings */
:root {
  --color-primary: #770000;
  --color-primary-container: #a30000;
  --color-primary-fixed: #ffdad4;
  --color-surface: #f8f9ff;
  --color-surface-container: #e5eeff;
  --color-surface-lowest: #ffffff;
  --color-on-surface: #0b1c30;
  --color-on-surface-variant: #5c403c;
  --color-inverse-surface: #213145;
  --color-outline: #906f6a;
  --color-outline-variant: #e5beb7;
  --font-family-main: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-family-main);
  background-color: var(--color-surface);
  color: var(--color-on-surface);
}

/* Background Patterns & Mesh Gradients */
.mesh-bg {
  background-color: #f8f9ff;
  background-image: 
    radial-gradient(at 85% 10%, rgba(119, 0, 0, 0.06) 0px, transparent 50%),
    radial-gradient(at 10% 60%, rgba(163, 0, 0, 0.05) 0px, transparent 50%),
    radial-gradient(at 50% 90%, rgba(33, 49, 69, 0.04) 0px, transparent 50%);
}

.pattern-bg {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23770000' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.dark-pattern-bg {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Glassmorphism */
.glass-nav {
  background: rgba(248, 249, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.glass-nav-scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px -2px rgba(11, 28, 48, 0.08);
}

.glass-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.glass-dark-card {
  background: rgba(33, 49, 69, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Custom Shadows */
.shadow-soft {
  box-shadow: 0 10px 30px rgba(119, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
}

.shadow-card-hover {
  box-shadow: 0 20px 40px rgba(119, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.shadow-glow-red {
  box-shadow: 0 0 25px rgba(163, 0, 0, 0.35);
}

/* Transitions & Animations */
.card-hover {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease;
}

.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(119, 0, 0, 0.08);
}

.float-anim {
  animation: float 6s ease-in-out infinite;
}

.float-anim-delayed {
  animation: float 7s ease-in-out infinite 1.5s;
}

.pulse-glow {
  animation: pulseGlow 2.5s infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-12px);
  }
}

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

/* Polygon Card Clips matching Brand Guide */
.clip-card {
  clip-path: polygon(0 0, 100% 0, 100% 88%, 92% 100%, 0 100%);
}

.clip-card-alt {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 8% 100%, 0 88%);
}

@media (max-width: 640px) {
  .clip-card, .clip-card-alt {
    clip-path: none;
  }
}

/* Scrollbar Customization */
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.custom-scrollbar::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.5);
  border-radius: 999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #a30000;
  border-radius: 999px;
}

/* Three.js Canvas Container */
.threejs-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 250px;
  overflow: hidden;
  border-radius: 1rem;
}

.threejs-canvas-wrapper canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: none;
}

/* Accordion Smooth Height Transition */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  opacity: 0;
}

.accordion-content.open {
  max-height: 500px;
  opacity: 1;
}

/* Modal Backdrop & Animations */
.modal-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  transform: translateY(20px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
}

.modal-backdrop.active .modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Toast Notification */
.toast-item {
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.toast-item.show {
  transform: translateX(0);
}

/* Badge active states */
.active-nav-link {
  color: var(--color-primary) !important;
  font-weight: 600;
  position: relative;
}

.active-nav-link::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 9999px;
}
