/* Design System for UPSC Practice Platform
 * 
 * Brand Identity:
 * - Serious, Calm, Academic, Examiner-like
 * - No hype, no buzzwords
 * - Muted colors, readable typography
 * - White space, calm layout
 */

/* ==========================================
   Color Palette (Muted, Academic)
   ========================================== */

:root {
  --primary-color: #2c3e50;      /* Dark blue-gray - serious, academic */
  --secondary-color: #495057;    /* Medium gray - calm, neutral */
  --accent-color: #6c757d;       /* Light gray - subtle */
  --success-color: #28a745;      /* Muted green - not neon */
  --danger-color: #dc3545;       /* Muted red - not bright */
  --light-bg: #f8f9fa;           /* Very light gray - calm background */
  --border-color: #dee2e6;       /* Subtle borders */
}

/* ==========================================
   Typography (Readable, Textbook-like)
   ========================================== */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--primary-color);
  line-height: 1.6;
  font-size: 1rem;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 500; /* Not too bold, not too light */
  color: var(--primary-color);
  line-height: 1.3;
}

.lead {
  font-weight: 400;
  color: var(--secondary-color);
}

/* ==========================================
   Buttons (Calm, Not Flashy)
   ========================================== */

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  font-weight: 500;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-primary:hover {
  background-color: #1a252f;
  border-color: #1a252f;
}

.btn-outline-secondary {
  border-color: var(--accent-color);
  color: var(--secondary-color);
  font-weight: 500;
}

.btn-outline-secondary:hover {
  background-color: var(--light-bg);
  border-color: var(--accent-color);
  color: var(--secondary-color);
}

/* ==========================================
   Cards (Clean, Minimal)
   ========================================== */

.card {
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* ==========================================
   Sections (White Space, Calm)
   ========================================== */

.section-block {
  margin-bottom: 0;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 3rem;
}

.hero-section {
  padding: 4rem 0;
  background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
}

/* ==========================================
   Step Cards (Process Flow)
   ========================================== */

.step-card {
  padding: 1.5rem;
  background-color: #ffffff;
  border-left: 3px solid var(--accent-color);
  border-radius: 0.25rem;
}

.step-card:hover {
  background-color: var(--light-bg);
  transition: background-color 0.2s ease;
}

/* ==========================================
   CTA Section (Calm, Not Pushy)
   ========================================== */

.cta-section {
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

/* ==========================================
   Sidebar Navigation (ChatGPT-style)
   ========================================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 220px;
  background-color: #ffffff;
  color: #2c3e50;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: width 0.3s ease, transform 0.3s ease;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.sidebar.collapsed {
  width: 60px;
}

/* On mobile, sidebar is always overlay (floating) */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
    z-index: 1001; /* Higher than overlay */
    width: 240px; /* Reduced width on mobile */
    top: 56px; /* Below mobile navbar */
    height: calc(100vh - 56px);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* On mobile, always show full width (ignore collapsed state) */
  .sidebar.collapsed {
    width: 240px;
  }
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  min-height: 60px;
  transition: padding 0.3s ease;
}

.sidebar.collapsed .sidebar-header {
  padding: 12px;
  justify-content: center;
  position: relative;
}

.sidebar.collapsed .sidebar-brand {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-collapse-toggle {
  position: absolute;
  right: 8px;
}

.sidebar-brand {
  color: #2c3e50;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.sidebar-brand:hover {
  color: #1a252f;
  text-decoration: none;
}

.sidebar-brand-text {
  color: inherit;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-brand-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-collapse-toggle {
  background: transparent;
  border: none;
  color: #2c3e50;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.sidebar-collapse-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.sidebar-collapse-toggle i {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c757d;
  padding: 8px 16px;
  margin-bottom: 4px;
  white-space: nowrap;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-section-title {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu-item {
  margin: 0;
}

.sidebar-menu-link {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  color: #2c3e50;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, padding 0.3s ease;
  font-size: 0.9rem;
  border-radius: 0;
  gap: 12px;
  position: relative;
}

.sidebar.collapsed .sidebar-menu-link {
  padding: 10px;
  justify-content: center;
}

/* Tooltip for collapsed sidebar items */
.sidebar.collapsed .sidebar-menu-link::after {
  content: attr(title);
  position: absolute;
  left: 100%;
  margin-left: 12px;
  padding: 6px 10px;
  background-color: #2c3e50;
  color: #ffffff;
  font-size: 0.875rem;
  white-space: nowrap;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar.collapsed .sidebar-menu-link:hover::after {
  opacity: 1;
}

.sidebar-menu-link i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  opacity: 0.8;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-menu-link i {
  width: auto;
}

.sidebar-menu-link span {
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-menu-link span {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-menu-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #1a252f;
  text-decoration: none;
}

.sidebar-menu-link.active {
  background-color: rgba(44, 62, 80, 0.1);
  color: #2c3e50;
  font-weight: 500;
}

.sidebar-menu-link.active i {
  opacity: 1;
}

.sidebar-section-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background-color: var(--primary-color);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.sidebar-user-details {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.875rem;
  color: #2c3e50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-user-details {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-user {
  justify-content: flex-start;
  padding: 12px 8px;
  position: relative;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-height: auto;
}

.sidebar.collapsed .sidebar-user-info {
  justify-content: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar.collapsed .sidebar-user-avatar {
  margin: 0 auto;
}

.sidebar.collapsed .sidebar-user-actions {
  position: static;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  margin-top: 0.5rem;
  display: flex;
}

.sidebar.collapsed .sidebar-user-signout,
.sidebar.collapsed .sidebar-user-action {
  position: static;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
  box-sizing: border-box;
}

.sidebar-user-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.sidebar-user-action,
.sidebar-user-signout {
  color: #2c3e50;
  padding: 6px;
  border-radius: 4px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.sidebar-user-action:hover,
.sidebar-user-signout:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #1a252f;
  text-decoration: none;
}

.sidebar-auth {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px;
}

.sidebar-auth-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  color: #2c3e50;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.sidebar-auth-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.3);
  color: #1a252f;
  text-decoration: none;
}

.sidebar-auth-link-primary {
  background-color: rgba(44, 62, 80, 0.1);
  border-color: rgba(44, 62, 80, 0.3);
}

.sidebar-auth-link-primary:hover {
  background-color: rgba(44, 62, 80, 0.15);
}

/* Main Content Wrapper */
.main-content-wrapper {
  min-height: 100vh;
  padding-top: 20px;
}

.main-content-wrapper-with-sidebar {
  margin-left: 220px;
  transition: margin-left 0.3s ease;
}

/* On mobile, main content never shifts */
@media (max-width: 768px) {
  .main-content-wrapper-with-sidebar {
    margin-left: 0 !important;
  }
}

.main-content-wrapper .alert {
  margin: 0 20px 20px 20px;
  border-radius: 4px;
}

/* Top navbar styling (for non-logged-in users) */
.navbar {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 500;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  color: #2c3e50;
  text-decoration: none;
}

.navbar-brand:hover {
  color: #1a252f;
}

.nav-link {
  display: flex;
  align-items: center;
}

.nav-link.active {
  font-weight: 500;
}

.nav-link i {
  font-size: 1rem;
}

/* Public navbar dropdown */
.navbar .dropdown-menu {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.1);
  margin-top: 0.5rem;
}

.navbar .dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.625rem 1rem;
  transition: background-color 0.2s ease;
}

.navbar .dropdown-item:hover {
  background-color: #f8f9fa;
}

.navbar .dropdown-item i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Hide overlay on desktop */
@media (min-width: 769px) {
  .sidebar-overlay {
    display: none !important;
  }
}

/* ==========================================
   Mobile Top Navbar
   ========================================== */

.mobile-navbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 1002;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 16px 0 0;
}

.mobile-navbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 0;
  padding-left: 0;
}

.mobile-navbar-brand {
  color: #000000;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.2s ease;
}

.mobile-navbar-brand:hover {
  color: #1a1a1a;
  text-decoration: none;
}

.mobile-navbar-toggle {
  background: transparent;
  border: none;
  color: #2c3e50;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  margin: 0;
  outline: none;
}

.mobile-navbar-toggle:focus {
  outline: none;
  box-shadow: none;
}

.mobile-navbar-toggle:active {
  outline: none;
}

.mobile-navbar-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.mobile-navbar-toggle i {
  font-size: 1.25rem;
}

.mobile-navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-navbar-icon-link {
  background: transparent;
  border: none;
  color: #2c3e50;
  text-decoration: none;
  padding: 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
  font-size: 1.25rem;
}

.mobile-navbar-icon-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #1a252f;
  text-decoration: none;
}

.mobile-navbar-icon-link.active {
  color: #2c3e50;
  background-color: rgba(44, 62, 80, 0.1);
}

.mobile-navbar-account-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.mobile-navbar-account {
  position: relative;
}

.mobile-navbar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  min-width: 220px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 1003;
}

.mobile-navbar-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-navbar-dropdown-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-navbar-dropdown-avatar {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background-color: var(--primary-color);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
  overflow: hidden;
}

.mobile-navbar-dropdown-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.mobile-navbar-dropdown-email {
  font-size: 0.875rem;
  color: #2c3e50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-navbar-dropdown-divider {
  height: 1px;
  background-color: rgba(0, 0, 0, 0.1);
  margin: 4px 0;
}

.mobile-navbar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #2c3e50;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
}

.mobile-navbar-dropdown-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #1a252f;
  text-decoration: none;
}

.mobile-navbar-dropdown-item i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.mobile-navbar-dropdown-item-danger {
  color: #f87171;
}

.mobile-navbar-dropdown-item-danger:hover {
  background-color: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

/* Show mobile navbar only on mobile */
@media (max-width: 768px) {
  .mobile-navbar {
    display: block;
  }

  .main-content-wrapper-with-sidebar {
    padding-top: 76px; /* 56px navbar + 20px padding */
  }

  /* Hide old mobile toggle button */
  .sidebar-mobile-toggle {
    display: none !important;
  }
}

/* Hide mobile navbar on desktop */
@media (min-width: 769px) {
  .mobile-navbar {
    display: none;
  }
}

/* Mobile Menu Toggle Button */
.sidebar-mobile-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1001;
  background-color: #202123;
  color: #ececf1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sidebar-mobile-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-mobile-toggle i {
  font-size: 1.25rem;
}

/* Responsive: Mobile - Additional mobile styles */
@media (max-width: 768px) {
  .sidebar-collapse-toggle {
    display: none; /* Hide collapse button on mobile */
  }

  .sidebar-mobile-toggle {
    display: block;
  }

  .sidebar-overlay.active {
    display: block;
  }

  /* Ensure sidebar sections are visible on mobile */
  .sidebar.collapsed .sidebar-section-title,
  .sidebar.collapsed .sidebar-menu-link span,
  .sidebar.collapsed .sidebar-brand-text,
  .sidebar.collapsed .sidebar-user-details {
    opacity: 1 !important;
    width: auto !important;
    overflow: visible !important;
    height: auto !important;
  }

  .sidebar.collapsed .sidebar-menu-link {
    padding: 10px 16px !important;
    justify-content: flex-start !important;
  }

  .sidebar.collapsed .sidebar-header {
    padding: 12px 16px !important;
    justify-content: space-between !important;
  }

  .sidebar.collapsed .sidebar-user {
    padding: 12px 16px !important;
    justify-content: space-between !important;
    flex-direction: row !important;
  }

  .sidebar.collapsed .sidebar-user-actions {
    position: static !important;
    flex-direction: row !important;
  }

  .sidebar.collapsed .sidebar-user-signout,
  .sidebar.collapsed .sidebar-user-action {
    position: static !important;
  }
}

/* Scrollbar Styling for Sidebar */
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ==========================================
   Footer (Minimal)
   ========================================== */

footer {
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
}

/* ==========================================
   Responsive Adjustments
   ========================================== */

@media (max-width: 768px) {
  .hero-section {
    padding: 2rem 0;
  }
  
  .section-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
  }
  
  .display-4 {
    font-size: 2rem;
  }
  
  .display-5 {
    font-size: 1.75rem;
  }
}

/* ==========================================
   Utility Classes
   ========================================== */

.text-academic {
  color: var(--primary-color);
}

.bg-academic {
  background-color: var(--light-bg);
}

/* ==========================================
   Devise Forms (Academic, Clean)
   ========================================== */

.devise-form-container {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
}

.devise-card {
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
}

.form-control-lg {
  border-color: var(--border-color);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control-lg:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(44, 62, 80, 0.1);
}

.form-label {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-text {
  font-size: 0.875rem;
  color: var(--accent-color);
  margin-top: 0.25rem;
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.form-check-label {
  font-size: 0.95rem;
  color: var(--secondary-color);
}

/* Devise error messages */
.alert-danger {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.alert-danger h6 {
  color: #721c24;
  font-weight: 500;
}

/* Devise links */
.devise-links a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.devise-links a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Remove any distracting animations */
* {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0.2s;
}

/* ==========================================
   Answer Annotation Viewer
   ========================================== */

.page-wrapper {
  position: relative;
  margin-bottom: 32px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.answer-page-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

.annotation-layer {
  position: absolute;
  inset: 0;
  pointer-events: none; /* Default: no pointer events */
  top: 16px;
  left: 16px;
  right: 16px;
  bottom: 16px;
}

/* Buttons and highlights should be clickable */
.annotation-layer button,
.annotation-layer .ocr-highlight {
  pointer-events: auto;
}

.ocr-highlight {
  position: absolute;
  border-radius: 4px;
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Section highlights - Light colors */
.ocr-highlight-introduction {
  background: rgba(59, 130, 246, 0.15); /* Light blue */
  border: 2px solid rgba(59, 130, 246, 0.4);
}

.ocr-highlight-introduction:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.6);
  z-index: 10;
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.ocr-highlight-body {
  background: rgba(34, 197, 94, 0.15); /* Light green */
  border: 2px solid rgba(34, 197, 94, 0.4);
}

.ocr-highlight-body:hover {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.6);
  z-index: 10;
  box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
}

.ocr-highlight-conclusion {
  background: rgba(168, 85, 247, 0.15); /* Light purple */
  border: 2px solid rgba(168, 85, 247, 0.4);
}

.ocr-highlight-conclusion:hover {
  background: rgba(168, 85, 247, 0.25);
  border-color: rgba(168, 85, 247, 0.6);
  z-index: 10;
  box-shadow: 0 4px 8px rgba(168, 85, 247, 0.3);
}

/* Feedback highlights - Dark colors */
.ocr-highlight-strength {
  background: rgba(22, 163, 74, 0.4); /* Dark green */
  border: 2px solid rgba(22, 163, 74, 0.7);
}

.ocr-highlight-strength:hover {
  background: rgba(22, 163, 74, 0.5);
  border-color: rgba(22, 163, 74, 0.9);
  z-index: 10;
  box-shadow: 0 4px 8px rgba(22, 163, 74, 0.4);
}

.ocr-highlight-weakness {
  background: rgba(220, 38, 38, 0.4); /* Dark red */
  border: 2px solid rgba(220, 38, 38, 0.7);
}

.ocr-highlight-weakness:hover {
  background: rgba(220, 38, 38, 0.5);
  border-color: rgba(220, 38, 38, 0.9);
  z-index: 10;
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.4);
}

/* Default highlight (fallback) */
.ocr-highlight-default {
  background: rgba(0, 180, 0, 0.25);
  border: 2px solid #0a8f08;
}

.ocr-highlight-default:hover {
  background: rgba(0, 200, 0, 0.35);
  border-color: #06a804;
  z-index: 10;
}

/* Tooltip styles */
.ocr-tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  max-width: 300px;
}

.ocr-tooltip-content {
  background: #333;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ocr-tooltip-block-id {
  font-weight: bold;
  margin-bottom: 4px;
  color: #4ade80;
}

.ocr-tooltip-text {
  line-height: 1.4;
  word-wrap: break-word;
}

/* Color legend styles */
.annotation-legend {
  border: 1px solid #dee2e6;
}

.legend-swatch {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 2px solid;
  flex-shrink: 0;
}

.legend-swatch-introduction {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
}

.legend-swatch-body {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
}

.legend-swatch-conclusion {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.4);
}

.legend-swatch-strength {
  background: rgba(22, 163, 74, 0.4);
  border-color: rgba(22, 163, 74, 0.7);
}

.legend-swatch-weakness {
  background: rgba(220, 38, 38, 0.4);
  border-color: rgba(220, 38, 38, 0.7);
}

/* Comment button styles */
.annotation-comment-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  font-weight: bold;
}

.annotation-comment-btn-strength {
  background: #16a34a; /* Green-600 */
  color: white;
  border-color: #15803d; /* Green-700 */
}

.annotation-comment-btn-strength:hover {
  background: #15803d; /* Darker green */
  transform: scale(1.15);
  box-shadow: 0 5px 12px rgba(22, 163, 74, 0.5);
}

.annotation-comment-btn-weakness {
  background: #dc2626; /* Red-600 */
  color: white;
  border-color: #b91c1c; /* Red-700 */
}

.annotation-comment-btn-weakness:hover {
  background: #b91c1c; /* Darker red */
  transform: scale(1.15);
  box-shadow: 0 5px 12px rgba(220, 38, 38, 0.5);
}

/* Active highlight (shown on button click) */
.ocr-highlight-active {
  animation: highlightPulse 0.3s ease;
}

@keyframes highlightPulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.02);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Feedback modal styles */
.feedback-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.feedback-modal-content {
  background: white;
  border-radius: 8px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.feedback-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feedback-modal-header-strength {
  background: rgba(22, 163, 74, 0.1);
  border-bottom-color: rgba(22, 163, 74, 0.3);
}

.feedback-modal-header-weakness {
  background: rgba(220, 38, 38, 0.1);
  border-bottom-color: rgba(220, 38, 38, 0.3);
}

.feedback-modal-header h6 {
  margin: 0;
  font-weight: 600;
}

.feedback-modal-body {
  padding: 20px;
  overflow-y: auto;
  line-height: 1.6;
  color: #495057;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .page-wrapper {
    padding: 8px;
    margin-bottom: 16px;
  }

  .annotation-layer {
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .ocr-tooltip {
    max-width: 250px;
  }

  .annotation-legend {
    font-size: 0.875rem;
  }

  .legend-swatch {
    width: 20px;
    height: 20px;
  }

  .annotation-comment-btn {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .feedback-modal-content {
    max-width: 90%;
    max-height: 90vh;
  }
}
