/* ===========================================
   RESULTS PAGE LAYOUT SYSTEM
   Clean, consistent spacing and typography
   =========================================== */

/* Prevent browser back/forward navigation on swipe gestures (touch laptops) */
html, body {
  overscroll-behavior-x: none;
  touch-action: pan-y pinch-zoom;
}

/* Base font stack */
.results-shell {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 48px 16px;
}

@media (min-width: 640px) {
  .results-shell {
    padding: 64px 24px;
  }
}

/* Typography Scale */
.results-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1e293b;
  margin: 0;
}

.results-section-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  color: #1e293b;
  margin: 0;
}

.results-item-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  color: #334155;
  margin: 0;
}

.results-body {
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.65;
  color: #475569;
  margin: 0;
}

.results-small {
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.5;
  color: #64748b;
  margin: 0;
}

/* Section Labels (module dividers) */
.section-label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 32px 0 16px;
}

.section-label::before,
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148,163,184,0.3), transparent);
}

.section-label span {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  white-space: nowrap;
}

/* Card System */
.results-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 10px 15px -3px rgba(0, 0, 0, 0.08);
  padding: 24px;
  margin-bottom: 16px;
}

/* Module Grid (2 columns on desktop) */
.module-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .module-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .module-grid .results-card {
    margin-bottom: 0;
  }
}

/* Section Header */
.results-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.results-header-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.results-header-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

/* Trait Tiles (RIASEC) */
.trait-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.trait-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.trait-tile-image {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.trait-tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trait-tile-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  text-align: center;
}

/* Strength Chips */
.strength-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.strength-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(209, 250, 229, 0.6);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #047857;
}

/* Note boxes (compact) */
.results-note {
  padding: 12px 16px;
  background: rgba(241, 245, 249, 0.7);
  border-radius: 10px;
  font-size: 0.8125rem;
  color: #64748b;
}

.results-note-title {
  font-weight: 600;
  color: #475569;
  margin-right: 4px;
}

/* Job Grid */
.job-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .job-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.job-chip-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-chip {
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(243,232,255,0.7) 0%, rgba(224,231,255,0.7) 100%);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 10px;
  font-size: 0.875rem;
  color: #5b21b6;
}

/* Next Step Box */
.next-step-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(209,250,229,0.6) 0%, rgba(204,251,241,0.6) 100%);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 14px;
}

.next-step-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #34d399 0%, #14b8a6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.next-step-icon svg {
  width: 18px;
  height: 18px;
  color: white;
}

/* Training Grid */
.training-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .training-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.training-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
}

.training-number {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fb7185 0%, #ec4899 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 2px 6px rgba(236, 72, 153, 0.3);
}

.training-content {
  flex: 1;
  min-width: 0;
}

.training-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
}

.training-motivation {
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  border: none;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: opacity 0.2s, transform 0.2s;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: background 0.2s;
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.95);
}

/* Footer */
.results-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 0 16px;
}

/* Lists */
.results-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.results-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.results-list li:last-child {
  margin-bottom: 0;
}

.results-list li svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

/* Utility spacing */
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }

/* Gradient helpers */
.gradient-purple { background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%); }
.gradient-amber { background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%); }
.gradient-emerald { background: linear-gradient(135deg, #34d399 0%, #14b8a6 100%); }
.gradient-blue { background: linear-gradient(135deg, #60a5fa 0%, #6366f1 100%); }
.gradient-rose { background: linear-gradient(135deg, #fb7185 0%, #ec4899 100%); }

/* Color utilities */
.text-purple-700 { color: rgb(126 34 206); }
.text-emerald-500 { color: rgb(16 185 129); }
.text-emerald-700 { color: rgb(4 120 87); }
.text-emerald-800 { color: rgb(6 95 70); }
.text-slate-700 { color: rgb(51 65 85); }

/* ===========================================
   PRINT STYLES - Optimized for single A4 page
   =========================================== */

@page {
  size: A4 portrait;
  margin: 8mm 10mm;
}

@media print {
  /* Force color printing and reset page */
  html {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  body {
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 10px !important;
  }
  
  /* Keep body visible but remove aurora styling */
  body.aurora-bg {
    background: white !important;
    display: block !important;
  }
  
  /* Remove decorative backgrounds without affecting layout */
  .bg-underlay,
  .noise-texture,
  .glass-reflection {
    display: none !important;
  }
  
  /* Aurora root needs to stay visible */
  .aurora-root {
    display: block !important;
  }
  
  /* Main layout container must stay visible */
  .min-h-screen.flex {
    display: block !important;
    min-height: auto !important;
    padding: 0 !important;
  }
  
  /* Content container must be visible */
  .relative.z-20 {
    display: block !important;
    position: static !important;
    padding: 0 !important;
    max-width: 100% !important;
    z-index: auto !important;
  }
  
  /* Neuromorphic card - clean for print */
  .neuromorphic-card {
    background: white !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }
  
  /* Section cards - very compact */
  .glass-input,
  section.glass-input {
    background: #f8fafc !important;
    box-shadow: none !important;
    border: 1px solid #e2e8f0 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 4px !important;
    margin-bottom: 6px !important;
    padding: 8px 10px !important;
    page-break-inside: avoid !important;
  }
  
  /* Very tight section spacing */
  .space-y-6 > * + * {
    margin-top: 6px !important;
  }
  
  .space-y-4 > * + * {
    margin-top: 3px !important;
  }
  
  /* Hide interactive elements */
  .results-footer,
  .btn-primary,
  .btn-secondary,
  button,
  .no-print,
  #loading-overlay {
    display: none !important;
  }
  
  /* Page title - compact */
  .text-2xl {
    font-size: 14px !important;
    margin-bottom: 2px !important;
  }
  
  /* Section titles */
  h2.text-xl,
  .text-xl {
    font-size: 11px !important;
    font-weight: 700 !important;
    margin-bottom: 4px !important;
  }
  
  /* Body text */
  p.text-sm,
  .text-sm {
    font-size: 9px !important;
    line-height: 1.35 !important;
  }
  
  .text-xs {
    font-size: 8px !important;
    line-height: 1.3 !important;
  }
  
  /* Profile images - much smaller */
  .w-20 {
    width: 40px !important;
  }
  
  .w-20.rounded-xl {
    border-radius: 6px !important;
  }
  
  /* Gap reductions */
  .gap-4 {
    gap: 6px !important;
  }
  
  .gap-3 {
    gap: 4px !important;
  }
  
  .gap-2 {
    gap: 3px !important;
  }
  
  /* Margin reductions */
  .mt-4 {
    margin-top: 4px !important;
  }
  
  .mt-2 {
    margin-top: 2px !important;
  }
  
  .mb-3 {
    margin-bottom: 3px !important;
  }
  
  /* Padding reductions */
  .p-3 {
    padding: 6px !important;
  }
  
  .p-5 {
    padding: 8px 10px !important;
  }
  
  .pt-2 {
    padding-top: 4px !important;
  }
  
  .pt-6 {
    padding-top: 0 !important;
  }
  
  /* Training grid - 2 columns, very compact */
  .grid-cols-1.sm\\:grid-cols-2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 4px !important;
  }
  
  /* Training cards */
  .grid-cols-1.sm\\:grid-cols-2 > div {
    padding: 5px !important;
    background: #f1f5f9 !important;
    border-radius: 4px !important;
  }
  
  /* Training number badges */
  .w-7.h-7 {
    width: 18px !important;
    height: 18px !important;
    font-size: 8px !important;
    border-radius: 4px !important;
  }
  
  /* Energy taker cards */
  .rounded-xl.bg-slate-100\\/60 {
    padding: 5px !important;
    border-radius: 4px !important;
  }
  
  .w-8.h-8 {
    width: 20px !important;
    height: 20px !important;
  }
  
  /* Badge pills */
  .px-3.py-1 {
    padding: 2px 6px !important;
    font-size: 7px !important;
  }
  
  /* Border utilities */
  .border-t {
    border-top-width: 1px !important;
    margin-top: 4px !important;
    padding-top: 4px !important;
  }
  
  /* Ensure images print with colors */
  img {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  /* Force colored backgrounds to print */
  [style*="background-color"],
  [style*="background: linear-gradient"],
  .bg-gradient-to-br,
  .bg-gradient-to-r {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  /* Hide sections marked as print-hide */
  .print-hide {
    display: none !important;
  }
}

/* ===========================================
   RIASEC SWIPE CARD - Responsive sizing
   =========================================== */

.riasec-card-container {
  height: clamp(340px, 58vh, 460px);
}

.riasec-card-image {
  height: clamp(200px, 40vh, 320px);
}

.riasec-card-prompt {
  height: clamp(100px, 16vh, 140px);
}

@media (max-height: 700px) {
  .riasec-card-container {
    height: clamp(300px, 55vh, 400px);
  }
  .riasec-card-image {
    height: clamp(180px, 36vh, 260px);
  }
  .riasec-card-prompt {
    height: clamp(90px, 14vh, 120px);
  }
}

[data-swipe-root] {
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

[data-role="card"] {
  touch-action: none;
}
