/* =================================================================
   Pachón Assessor IA - Premium Healthcare Design with Magic UI
   Version 3.0 - 2024
   ================================================================= */

/* =================================================================
   1. CSS Variables & Design System
   ================================================================= */
:root {
  /* Premium Healthcare Colors */
  --health-primary: #0ea5e9;
  --health-secondary: #06b6d4;
  --health-accent: #3b82f6;
  --health-glow: #60a5fa;
  --professional-dark: #0f172a;
  
  /* Legacy Primary Colors (for compatibility) */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;

  /* Healthcare Accent Colors */
  --health-cyan: #06b6d4;
  --health-green: #10b981;
  --health-purple: #7c3aed;
  --health-blue: #0ea5e9;
  
  /* Magic UI Animation Variables */
  --magic-duration: 3s;
  --magic-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --shimmer-color: #ffffff;
  --beam-size: 200px;
  --glow-intensity: 0.5;

  /* Neutral Colors */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Semantic Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* Spacing System (8px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Montserrat', var(--font-sans);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* =================================================================
   2. Global Reset & Base Styles
   ================================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--gray-800);
  background-color: var(--gray-50);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography Base */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--gray-900);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

/* Links */
a {
  color: var(--primary-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-700);
}

/* =================================================================
   3. Layout Components
   ================================================================= */

/* Page Wrapper */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--gray-50) 0%, #ffffff 100%);
}

/* Header */
.header-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-section {
  text-align: center;
}

.title-section h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  color: var(--primary-600);
  text-shadow: 0 2px 4px rgba(14, 165, 233, 0.1);
  margin-bottom: var(--space-2);
}

.title-section p {
  font-size: clamp(0.875rem, 2vw, 1.125rem);
  color: var(--gray-600);
  font-weight: 500;
}

/* Main Container */
.main-container {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

/* Content Box - Main Card */
.content-box {
  background: white;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8);
  border: 1px solid var(--gray-100);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

/* =================================================================
   4. Form Elements & Inputs
   ================================================================= */

/* Upload Area - Hidden but functional */
.hidden-upload-label {
  display: none !important;
}

/* Textarea Styling */
textarea {
  width: 100%;
  min-height: 200px;
  padding: var(--space-4);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  resize: vertical;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  line-height: 1.6;
}

textarea:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea::placeholder {
  color: var(--gray-400);
}

/* Labels */
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}

/* Select Dropdown */
select {
  appearance: none;
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  color: var(--gray-800);
  cursor: pointer;
  transition: all var(--transition-fast);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right var(--space-3) center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: var(--space-10);
}

select:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* =================================================================
   5. Tab Components
   ================================================================= */

/* Input Tabs */
.input-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  border-bottom: 2px solid var(--gray-200);
  overflow-x: auto;
  scrollbar-width: none;
}

.input-tabs::-webkit-scrollbar {
  display: none;
}

.input-tab-button {
  padding: var(--space-3) var(--space-6);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-600);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
}

.input-tab-button:hover {
  color: var(--gray-800);
}

.input-tab-button.active {
  color: var(--primary-600);
  border-bottom-color: var(--primary-600);
}

.input-tab-content {
  animation: fadeIn var(--transition-base);
}

/* Result Tabs */
.tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-6);
  background: var(--gray-100);
  padding: var(--space-1);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}

.tabs::-webkit-scrollbar {
  height: 6px;
}

.tabs::-webkit-scrollbar-track {
  background: transparent;
}

.tabs::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}

.tab-button {
  padding: var(--space-2) var(--space-4);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-600);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-button:hover {
  color: var(--gray-800);
  background: rgba(255, 255, 255, 0.5);
}

.tab-button.active {
  color: var(--primary-700);
  background: white;
  box-shadow: var(--shadow-sm);
}

/* =================================================================
   6. Activity Buttons - REFATORADO COMPLETAMENTE
   ================================================================= */

/* Botão Principal - Design Simples e Funcional */
.activity-option {
  width: 100%;
  min-height: 60px;
  padding: 16px 24px;
  background: #3b82f6 !important; /* Azul sólido - sem gradiente */
  color: #ffffff !important;
  border: 2px solid #2563eb !important;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: visible;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  text-decoration: none;
  outline: none;
}

/* Remove todos os pseudo-elementos */
.activity-option::before,
.activity-option::after {
  display: none !important;
}

/* Label do Texto - SEMPRE VISÍVEL */
.activity-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: #ffffff !important; /* Texto sempre branco */
  text-align: center;
  letter-spacing: 0.3px;
  position: relative;
  z-index: 2;
  gap: 10px;
  width: 100%;
  pointer-events: none;
}

/* Ícone Simples */
.activity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff !important;
}

.activity-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  stroke: #ffffff !important;
  fill: none;
}

/* Estado Hover - Simples e Claro */
.activity-option:hover {
  background: #2563eb !important; /* Azul mais escuro */
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-color: #1d4ed8 !important;
}

/* Estado Ativo/Selecionado */
.activity-option.active {
  background: #1e40af !important; /* Azul ainda mais escuro */
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: #1e3a8a !important;
}

.activity-option.active .activity-label {
  color: #ffffff !important;
  font-weight: 700;
}

/* Estado de Clique */
.activity-option:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Remove TODAS as animações complexas */
.activity-option * {
  animation: none !important;
}

/* Remove elementos desnecessários */
.glow-border,
.particle-container,
.particle,
.ripple-effect {
  display: none !important;
}

/* Responsivo */
@media (max-width: 768px) {
  .activity-option {
    min-height: 55px;
    padding: 12px 20px;
  }
  
  .activity-label {
    font-size: 0.875rem;
  }
}

/* =================================================================
   7. Buttons
   ================================================================= */

button {
  font-family: var(--font-sans);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

/* Primary Button - Analyze */
#analyzeBtn {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  color: white;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-full);
  font-size: 1rem;
  box-shadow: var(--shadow-md);
  min-width: 200px;
  position: relative;
  overflow: hidden;
}

#analyzeBtn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

#analyzeBtn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

#analyzeBtn:hover::before {
  width: 300px;
  height: 300px;
}

#analyzeBtn:active {
  transform: translateY(0);
}

#analyzeBtn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

#analyzeBtn.loading {
  color: transparent;
}

/* Secondary Buttons */
.copy-btn, .format-btn, .print-btn {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.copy-btn:hover, .format-btn:hover, .print-btn:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

/* Style for format toolbar */
.format-toolbar {
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-2);
  padding: 4px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
}

.format-toolbar .format-btn {
  padding: 4px 8px;
  background: transparent;
}

.format-toolbar .format-btn:hover {
  background: var(--gray-200);
}

/* Success State for Copy Button */
.copy-btn.success {
  background: var(--success);
  color: white;
}

/* =================================================================
   8. Tooltips
   ================================================================= */

.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: var(--space-2);
  color: var(--gray-400);
  font-size: 0.875rem;
  cursor: help;
  transition: all var(--transition-fast);
  border-radius: var(--radius-full);
}

.tooltip-icon:hover {
  color: var(--primary-600);
  background: var(--primary-50);
}

/* =================================================================
   9. Results Section
   ================================================================= */

.result-section {
  margin-top: var(--space-8);
}

.tab-content {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-100);
  animation: fadeIn var(--transition-base);
}

.tab-content h2 {
  font-size: 1.25rem;
  margin-bottom: var(--space-4);
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.result-content {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--gray-700);
  margin-top: var(--space-4);
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: 'Courier New', monospace; /* Monospace para conteúdo com marcações */
}

/* Ajuste de margens padrão para parágrafos dentro de resultados */
.result-content p {
  margin: 0 0 var(--space-2) 0;
}

/* Para a aba resumo que tem formatação visual */
#resumo .result-content {
  font-family: var(--font-sans);
  line-height: 1.8;
}

/* Estilos para tabelas no conteúdo */
.result-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-4) 0;
  font-size: 0.9rem;
}

.result-content th,
.result-content td {
  border: 1px solid var(--gray-300);
  padding: var(--space-2) var(--space-3);
  text-align: left;
}

.result-content th {
  background-color: var(--gray-100);
  font-weight: 600;
  color: var(--gray-800);
}

.result-content tr:nth-child(even) {
  background-color: var(--gray-50);
}

/* Estilos para listas */
.result-content ul,
.result-content ol {
  margin: var(--space-3) 0;
  padding-left: var(--space-6);
}

.result-content li {
  margin-bottom: var(--space-2);
}

/* Estilos para títulos gerados pelo markdown */
.result-content h1,
.result-content h2,
.result-content h3 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  color: var(--gray-900);
}

.result-content h1 {
  font-size: 1.5rem;
}

.result-content h2 {
  font-size: 1.25rem;
}

.result-content h3 {
  font-size: 1.1rem;
}

/* Estilos para código inline */
.result-content code {
  background-color: var(--gray-100);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

/* Para todas as abas exceto resumo, preserva fonte monoespaçada para marcações */
.tab-content:not(#resumo) .result-content {
  font-family: 'Courier New', monospace;
}

.result-content[contenteditable="true"] {
  outline: none;
  padding: var(--space-6);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  min-height: 300px;
  max-height: 600px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
}

.result-content[contenteditable="true"]:focus {
  background: white;
  box-shadow: inset 0 0 0 2px var(--primary-200);
  border-color: var(--primary-400);
}

/* Estilos para elementos formatados da API */
.formatted-title {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  margin: var(--space-4) 0 var(--space-3);
  color: var(--gray-900);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.formatted-subtitle {
  font-weight: 600;
  color: var(--gray-800);
  display: inline-block;
  margin-top: var(--space-3);
  margin-bottom: var(--space-2);
}

.formatted-section {
  margin-bottom: var(--space-4);
  padding-left: var(--space-4);
}

.formatted-list-item {
  margin-left: var(--space-6);
  margin-bottom: var(--space-1);
  list-style-type: disc;
}

/* Ajuste de espaçamento para a aba resumo */
#resumo .result-content {
  line-height: 1.8;
}

#resumo .result-content p {
  margin-bottom: var(--space-2);
}

#resumo .result-content p:empty {
  display: none;
}

#resumo .result-content br + br {
  display: none;
}

#resumo .result-content h2 {
  margin-top: var(--space-3);
  margin-bottom: var(--space-2);
}

#resumo .result-content .formatted-subtitle {
  display: block;
  margin-top: var(--space-3);
  margin-bottom: var(--space-1);
}

/* Scrollbar customizada para result-content */
.result-content::-webkit-scrollbar {
  width: 8px;
}

.result-content::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: var(--radius-full);
}

.result-content::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: var(--radius-full);
}

.result-content::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* =================================================================
   10. Loading States
   ================================================================= */

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Auto Analysis Notification */
#auto-analysis-notification {
  background: linear-gradient(135deg, var(--info) 0%, var(--primary-600) 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-md);
}

#auto-analysis-notification svg {
  width: 24px;
  height: 24px;
}

/* =================================================================
   11. Utility Classes
   ================================================================= */

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: var(--space-2);
}

.gap-4 {
  gap: var(--space-4);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-6 {
  margin-bottom: var(--space-6);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-2 {
  margin-top: var(--space-2);
}

/* =================================================================
   12. Animations
   ================================================================= */

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

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

/* Page Load Animation */
.page-wrapper {
  animation: fadeIn 0.6s ease-out;
}

.content-box {
  animation: slideIn 0.8s ease-out 0.2s both;
}

/* =================================================================
   13. Responsive Design
   ================================================================= */

@media (max-width: 768px) {
  :root {
    font-size: 14px;
  }

  .main-container {
    padding: var(--space-4);
  }

  .content-box {
    padding: var(--space-6);
    border-radius: var(--radius-xl);
  }

  .title-section h1 {
    font-size: 2rem;
  }

  .title-section p {
    font-size: 1rem;
  }

  .activity-option {
    padding: var(--space-4);
  }

  #analyzeBtn {
    width: 100%;
    padding: var(--space-4) var(--space-6);
  }

  .tabs {
    gap: 0;
  }

  .tab-button {
    padding: var(--space-2) var(--space-3);
    font-size: 0.8rem;
  }

  select {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: var(--space-3) var(--space-4);
  }

  .content-box {
    padding: var(--space-4);
  }

  textarea {
    min-height: 150px;
  }
}

/* =================================================================
   14. Print Styles
   ================================================================= */

@media print {
  .header-container,
  .input-tabs,
  .activity-option,
  #analyzeBtn,
  .copy-btn,
  .format-btn,
  .print-btn,
  select {
    display: none !important;
  }

  body {
    background: white;
  }

  .content-box {
    box-shadow: none;
    border: none;
    padding: 0;
  }

  .tab-content {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }

  .tab-content.active-for-print {
    display: block !important;
  }
}

/* =================================================================
   15. Focus States for Accessibility
   ================================================================= */

*:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

button:focus-visible {
  outline-offset: 4px;
}

/* =================================================================
   16. Custom Scrollbar
   ================================================================= */

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: var(--radius-full);
  border: 3px solid var(--gray-100);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--gray-400) var(--gray-100);
}

/* =================================================================
   17. Font Size Controls (from original)
   ================================================================= */

.font-size-1 { font-size: 0.75rem; }
.font-size-2 { font-size: 0.875rem; }
.font-size-3 { font-size: 1rem; }
.font-size-4 { font-size: 1.125rem; }
.font-size-5 { font-size: 1.25rem; }
.font-size-6 { font-size: 1.5rem; }

/* =================================================================
   18. Magic UI Components
   ================================================================= */

/* Shimmer Button Animations */
@keyframes shimmer-slide {
  to {
    transform: translate(calc(100cqw - 100%), 0);
  }
}

@keyframes spin-around {
  to {
    transform: rotate(360deg);
  }
}

.shimmer-button {
  background: var(--bg);
  border-radius: var(--radius);
  position: relative;
  transition: all 0.3s ease;
}

.shimmer-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.3);
}

.shimmer-button:active {
  transform: translateY(0);
}

/* Magic Card Styles */
.magic-card {
  background: white;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.magic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--health-primary), var(--health-secondary));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.magic-card:hover::before {
  opacity: 0.1;
}

.magic-card:hover {
  border-color: var(--health-primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.15);
}

/* Border Beam Animation */
@keyframes border-beam {
  from {
    offset-distance: 0%;
  }
  to {
    offset-distance: 100%;
  }
}

.border-beam {
  position: absolute;
  pointer-events: none;
}

/* Activity Option Enhanced Styles */
.activity-option {
  min-height: 80px;
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  background: white;
  border: 2px solid var(--gray-200);
}

.activity-option:hover {
  border-color: var(--health-primary);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
}

.activity-option.active {
  border-color: var(--health-primary);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
  box-shadow: 0 8px 16px rgba(14, 165, 233, 0.15);
}

.activity-label {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.95rem;
  gap: var(--space-3);
}

/* Tooltip Icon Alignment Fix */
.tooltip-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-500);
  transition: all 0.2s ease;
}

.tooltip-icon:hover {
  background: var(--health-primary);
  color: white;
  transform: scale(1.1);
}

/* Button Consistency Fixes */
.copy-btn, .print-btn {
  height: 40px;
  min-width: 100px;
  padding: 0 var(--space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.copy-btn:hover, .print-btn:hover {
  background: var(--health-primary);
  color: white;
  border-color: var(--health-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(14, 165, 233, 0.2);
}

.copy-btn svg, .print-btn svg {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0;
}

/* Format Buttons Enhancement */
.format-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.format-btn svg {
  width: 20px !important;
  height: 20px !important;
}

.format-btn:hover {
  background: var(--health-primary);
  color: white;
}

/* Tab Button Consistency */
.tab-button {
  height: 40px;
  padding: 0 var(--space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-button:hover {
  background: rgba(14, 165, 233, 0.1);
  color: var(--health-primary);
}

.tab-button.active {
  background: var(--health-primary);
  color: white;
  box-shadow: 0 2px 4px rgba(14, 165, 233, 0.2);
}

/* Premium Header Gradient */
.header-container {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 249, 255, 0.98) 100%);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(14, 165, 233, 0.1);
}

.title-section h1 {
  color: var(--primary-600);
  text-shadow: 0 2px 4px rgba(14, 165, 233, 0.1);
}

/* Enhanced Loading State */
#analyzeBtn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Responsive Grid Enhancement */
@media (max-width: 768px) {
  .activity-option {
    min-height: 70px;
    padding: var(--space-4);
  }
  
  .activity-label {
    font-size: 0.875rem;
  }
  
  .tooltip-icon {
    width: 18px;
    height: 18px;
    font-size: 0.75rem;
  }
}

/* Magic Action Buttons */
.magic-action-button {
  position: relative;
  overflow: hidden;
}

.magic-action-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.magic-action-button:hover::before {
  width: 100px;
  height: 100px;
}

/* =================================================================
   18. Print Styles
   ================================================================= */

@media print {
  /* Hide everything except the content to print */
  body * {
    visibility: hidden;
  }
  
  .print-content, .print-content * {
    visibility: visible;
  }
  
  .print-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white;
    padding: 20mm;
  }
  
  /* Hide UI elements during print */
  .header-container,
  .input-tabs,
  .activity-option,
  #analyzeBtn,
  .copy-btn,
  .format-btn,
  .print-btn,
  .format-toolbar,
  .tabs,
  select,
  .tooltip-icon {
    display: none !important;
  }
  
  /* Print-specific formatting */
  .formatted-title {
    page-break-after: avoid;
    font-size: 18pt;
    margin: 20pt 0;
  }
  
  .formatted-subtitle {
    page-break-after: avoid;
    font-size: 14pt;
    margin-top: 15pt;
  }
  
  .result-content {
    font-size: 11pt;
    line-height: 1.6;
    color: black;
    background: white;
    border: none;
    box-shadow: none;
    padding: 0;
    max-height: none;
  }
  
  /* Ensure proper page breaks */
  .formatted-section {
    page-break-inside: avoid;
  }
  
  /* Remove backgrounds and borders */
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  /* Links */
  a, a:visited {
    text-decoration: underline;
  }
  
  /* Page margins */
  @page {
    margin: 20mm;
    size: A4;
  }
}

/* Print preview helper class */
.print-preview {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  z-index: 9999;
  padding: 20mm;
  overflow: auto;
}

/* =================================================================
   End of Stylesheet
   ================================================================= */