/* CA Student Learning & Test Platform - Stylesheet */

:root {
  --primary-900: #0f172a;
  --primary-800: #1e293b;
  --primary-700: #334155;
  --brand-blue: #1e40af;
  --brand-blue-hover: #1d4ed8;
  --brand-blue-light: #eff6ff;
  --brand-emerald: #059669;
  --brand-emerald-light: #ecfdf5;
  --brand-amber: #d97706;
  --brand-amber-light: #fffbeb;
  --brand-rose: #e11d48;
  --brand-rose-light: #fff1f2;
  --brand-purple: #7c3aed;
  --brand-purple-light: #f5f3ff;
}

html, body {
  overflow-x: hidden;
  width: 100%;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Question Palette Status Colors */
.btn-palette {
  transition: all 0.15s ease-in-out;
}
.btn-palette.current {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
  font-weight: 700;
}
.btn-palette.answered {
  background-color: #10b981;
  color: #ffffff;
  border-color: #059669;
}
.btn-palette.marked {
  background-color: #8b5cf6;
  color: #ffffff;
  border-color: #7c3aed;
}
.btn-palette.unanswered {
  background-color: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
.btn-palette.unanswered:hover {
  background-color: #e2e8f0;
  color: #1e293b;
}

/* Aspect ratio for video responsive embed */
.aspect-video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 0.75rem;
  background-color: #0f172a;
}
.aspect-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Options radio card design */
.option-card {
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}
.option-card:hover {
  border-color: #93c5fd;
  background-color: #f8fafc;
}
.option-card.selected {
  border-color: #2563eb;
  background-color: #eff6ff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.1);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}
.toast-msg {
  pointer-events: auto;
  animation: slideInUp 0.25s ease-out forwards;
}
.toast-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Mobile & Touch Responsive Enhancements */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Prevent iOS/Safari and Android browser auto-zooming on form input focus */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Touch targets min-height 44px */
.touch-target {
  min-height: 44px;
  min-width: 44px;
}

/* Responsive Table Scroll Container */
.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Word break helper to prevent horizontal overflow */
.break-anywhere {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Responsive toast positioning on narrow screens */
@media (max-width: 640px) {
  #toast-container {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    align-items: center;
  }
  .toast-msg {
    width: 100%;
    max-width: 100%;
  }
}

