/* Custom styles and enhancements for OS Online Exam System */
:root {
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  --success-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
  --danger-gradient: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

/* Safe area support for iOS / Modern mobile devices */
.safe-bottom {
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
}
.dark ::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.25);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.45);
}

/* Option transitions */
.option-btn {
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.option-btn:hover:not(.disabled) {
  transform: translateY(-1px);
}

.option-btn:active:not(.disabled) {
  transform: scale(0.99);
}

/* Glassmorphism effects */
.glass-panel {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.dark .glass-panel {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Keyframe animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.animate-fade-in {
  animation: fadeIn 0.2s ease-out forwards;
}

.animate-scale-up {
  animation: scaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Answer Sheet Grid items */
.sheet-num-btn {
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.sheet-num-btn:active {
  transform: scale(0.92);
}

/* Mobile Bottom Nav Tab Active state */
.mobile-tab-btn {
  transition: color 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.mobile-tab-btn.active {
  color: #4f46e5;
}
.dark .mobile-tab-btn.active {
  color: #818cf8;
}

/* Focus outlines for accessibility */
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* Typography styles */
.question-content {
  line-height: 1.7;
  letter-spacing: 0.01em;
  word-break: break-word;
}

/* Touch optimization for mobile */
button, input, select {
  touch-action: manipulation;
}

/* Print optimizations for score sheets */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .no-print, header, nav, footer, #mobile-bottom-nav {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
}
