:root {
  --primary-color: #A41849;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --danger-color: #dc3545;
  --info-color: #0dcaf0;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --white: #ffffff;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
  --shadow: 0 .5rem 1rem rgba(0,0,0,.15);
  --shadow-lg: 0 1rem 3rem rgba(0,0,0,.175);
  --border-radius: 12px;
  --font-family: 'Inter', 'Poppins', sans-serif;
}

/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--light-color);
  color: var(--dark-color);
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
}

.h1-responsive { font-size: clamp(2rem, 5vw, 3.5rem); }
.h2-responsive { font-size: clamp(1.5rem, 4vw, 2.5rem); }
.p-responsive { font-size: clamp(0.9rem, 2vw, 1.1rem); }

/* Layout & Containers */
.container-custom {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Nav Improvements */
.navbar-custom {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: var(--transition);
}

.nav-link-custom {
  font-weight: 500;
  color: var(--dark-color);
  transition: var(--transition);
  position: relative;
}

.nav-link-custom:after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: var(--transition);
}

.nav-link-custom:hover:after {
  width: 100%;
}

/* Responsive Grid/Flex Utilities */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Card Enhancements */
.card-saas {
  background: var(--white);
  border-radius: var(--border-radius);
  border: 1px solid rgba(0,0,0,0.05);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card-saas:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1001;
}

@media (max-width: 768px) {
  .mobile-nav-toggle {
    display: block;
  }
  
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--white);
    padding: 80px 2rem 2rem;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transition: 0.4s ease-in-out;
    z-index: 1000;
  }
  
  .nav-menu.active {
    right: 0;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* CBT Specific Styles (Responsive) */
.exam-header {
  padding: 0.75rem 0;
}

.floating-palette-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  border: none;
  box-shadow: var(--shadow-lg);
  display: none; /* Hidden by default, shown on mobile */
  align-items: center;
  justify-content: center;
  z-index: 1050;
  transition: var(--transition);
}

.floating-palette-btn:hover {
  transform: scale(1.1);
  background-color: #8c143e;
}

@media (max-width: 991px) {
  .floating-palette-btn {
    display: flex;
  }
  
  .desktop-palette {
    display: none;
  }
}

@media (max-width: 576px) {
  .exam-header-compact {
    flex-direction: row !important;
    justify-content: space-between !important;
    padding: 0.5rem 1rem !important;
  }
  
  .exam-header-compact .logo-section img {
    width: 32px !important;
    height: 32px !important;
  }
  
  .exam-header-compact .logo-section h1,
  .exam-header-compact .logo-section h2 {
    font-size: 0.75rem !important;
  }
  
  .exam-header-compact #timer {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.85rem !important;
  }
}

/* Table Responsiveness */
.table-responsive-custom {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Button Refinements */
.btn-saas {
  border-radius: 8px;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary-saas {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
}

.btn-primary-saas:hover {
  background-color: #8c143e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(164, 24, 73, 0.3);
}

/* Score Circle Responsive */
.result-circle-container {
  position: relative;
  width: min(200px, 50vw);
  height: min(200px, 50vw);
}

/* Form Responsiveness */
.form-control-saas {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  border: 1px solid #dee2e6;
  transition: var(--transition);
}

.form-control-saas:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(164, 24, 73, 0.1);
}

/* Animations from existing CSS */
.animate-fade-in { animation: fadeIn 0.5s ease-out forwards; }
.animate-slide-in { animation: slideIn 0.5s ease-out forwards; }
.animate-scale-in { animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

@keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

.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; }

.hover-lift { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.hover-lift:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important; }

.pulse-primary { animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(164, 24, 73, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(164, 24, 73, 0); } 100% { box-shadow: 0 0 0 0 rgba(164, 24, 73, 0); } }

.input-focus-effect:focus { transform: translateY(-2px); transition: transform 0.2s ease; }

.extra-small {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.result-circle-bg { fill: none; stroke: #eee; stroke-width: 8; }
.result-circle-progress { fill: none; stroke: var(--primary-color); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1.5s ease-out; }

.icon-circle { width: 80px; height: 80px; background: rgba(164, 24, 73, 0.1); color: var(--primary-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; }

.option-btn {
  text-align: left;
  padding: 1rem 1.5rem;
  border: 2px solid #eee;
  border-radius: 12px;
  background: #fff;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.option-btn:hover { border-color: var(--primary-color); background: rgba(164, 24, 73, 0.02); }
.option-btn.selected { border-color: var(--primary-color); background: rgba(164, 24, 73, 0.05); }

.palette-btn {
  width: 35px;
  height: 35px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid #dee2e6;
  background: #fff;
}

.palette-btn.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.palette-btn.answered { background: var(--success-color); color: #fff; border-color: var(--success-color); }

/* Table Styles */
.table thead th {
  background-color: #f8f9fa;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  font-weight: 700;
  border-bottom: 2px solid #dee2e6;
}


/* h1, h2, h3 {
  font-family: 'Poppins', sans-serif;
} */


button {
  font-weight: 500;
}

small, .text-muted {
  font-weight: 400;
}

body {
  line-height: 1.4;
}

.card {
  border-radius: 12px;
}

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

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #999;
}
