/* RDSS Quality Control Lab - Shared CSS Primitives & Icons (100% Offline) */

:root {
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
}

body {
  line-height: 1.6;
  overflow-x: hidden;
  background-color: #f8fafc;
  color: #1e293b;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Offline Universal Style Switcher Bar */
.style-switcher-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f8fafc;
  font-size: 11px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  height: 28px;
}

.style-switcher-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.style-switcher-title svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #38bdf8;
  stroke-width: 2;
}

.style-switcher-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.style-btn {
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
}

.style-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  transform: translateY(-1px);
}

.style-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.style-btn.v1-active {
  background: linear-gradient(135deg, #1e293b, #2563eb);
  border-color: #38bdf8;
}

.style-btn.v2-active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #38bdf8;
}

.style-btn.v3-active {
  background: linear-gradient(135deg, #008baf, #006680);
  color: #ffffff;
  border-color: #38bdf8;
}

.style-btn.v4-active {
  background: linear-gradient(135deg, #008baf, #005f77);
  color: #ffffff;
  border-color: #67e8f9;
}

/* SVG Icon Helpers */
.svg-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  animation: slideInRight 0.3s ease forwards;
}

.toast.success {
  border-left: 4px solid #10b981;
}

.toast.info {
  border-left: 4px solid #3b82f6;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Global Modal Overlay Styles (Hidden by default, fixed full screen) */
.v1-modal-overlay {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 100000 !important;
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
}

.v1-modal {
  background: #ffffff !important;
  border-radius: var(--radius-lg) !important;
  max-width: 520px !important;
  width: 100% !important;
  padding: 32px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35) !important;
  position: relative !important;
  animation: modalPop 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.v1-modal-close {
  position: absolute !important;
  top: 18px !important;
  right: 20px !important;
  background: transparent !important;
  border: none !important;
  color: #64748b !important;
  font-size: 28px !important;
  cursor: pointer !important;
  line-height: 1 !important;
  transition: color 0.2s ease;
}

.v1-modal-close:hover {
  color: #0f172a !important;
}

/* Interactive Schedule Sample Test Form Primitives */
.interactive-schedule-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
  border: 1px solid #e2e8f0;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}

.schedule-header-text h3 {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
}

.schedule-header-text p {
  font-size: 14px;
  color: #64748b;
  margin-top: 4px;
}

/* Step Progress Indicator */
.step-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  margin-bottom: 30px;
  overflow: hidden;
  position: relative;
}

.step-progress-bar-fill {
  height: 100%;
  width: 33.33%;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  border-radius: 9999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-pills-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.step-pill-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  transition: var(--transition-fast);
}

.step-pill-item.active {
  color: #2563eb;
}

.step-pill-item.completed {
  color: #10b981;
}

.step-circle-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  transition: var(--transition-fast);
}

.step-pill-item.active .step-circle-num {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.3);
}

.step-pill-item.completed .step-circle-num {
  background: #10b981;
  color: #ffffff;
}

/* Interactive Discipline Select Grid */
.discipline-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.discipline-pill-btn {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 18px 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.discipline-pill-btn:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: translateY(-2px);
}

.discipline-pill-btn.selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.18);
}

.discipline-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  font-size: 20px;
}

.discipline-pill-btn.selected .discipline-icon-box {
  background: #2563eb;
  color: #ffffff;
}

.discipline-label {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.discipline-sub {
  font-size: 11px;
  color: #64748b;
}

/* Interactive Counter Box */
.counter-box, .sample-counter-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 6px 14px;
  width: fit-content;
}

.counter-input {
  width: 44px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  border: none;
  background: transparent;
  outline: none;
}

.counter-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.counter-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.counter-val {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  min-width: 30px;
  text-align: center;
}

/* Floating Live Summary Badge */
.live-summary-badge {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  position: relative;
  overflow: hidden;
}

.live-summary-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #10b981;
}

.live-badge-title {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.live-badge-main {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

.live-badge-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #34d399;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 10px;
}

/* Form Steps Layout */
.form-step-pane {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.form-step-pane.active-step {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Global Table Responsive Wrapper */
.table-responsive-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Mobile Responsiveness for Shared Components */
@media (max-width: 768px) {
  .style-switcher-bar {
    padding: 2px 10px;
    height: auto;
    min-height: 28px;
    flex-wrap: wrap;
    gap: 4px;
  }
  
  .style-switcher-title span {
    display: none;
  }
  
  .style-switcher-links {
    overflow-x: auto;
    width: 100%;
    justify-content: flex-start;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  
  .style-btn {
    font-size: 10px;
    padding: 2px 6px;
    white-space: nowrap;
  }

  .interactive-schedule-card {
    padding: 16px !important;
  }

  .discipline-picker-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
    gap: 10px !important;
  }

  .discipline-pill-btn {
    padding: 10px !important;
  }

  .discipline-icon-box {
    font-size: 20px !important;
  }

  .discipline-label {
    font-size: 12px !important;
  }

  .step-pill-item span {
    font-size: 11px !important;
  }

  .fee-estimate-box {
    flex-direction: column !alignment: flex-start !important;
    gap: 12px !important;
    align-items: flex-start !important;
  }

  .fee-estimate-box div:last-child {
    text-align: left !important;
  }
}

@media (max-width: 540px) {
  .step-pills-row {
    gap: 4px !important;
  }
  
  .step-pill-item span {
    display: none;
  }
}
