:root {
  --ramsey-primary: #6f42c1;
  --ramsey-secondary: #5936b4;
  --ramsey-light: rgba(111, 66, 193, 0.1);
  --ramsey-border: rgba(111, 66, 193, 0.2);
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #17a2b8;
}

/* Header migliorato */
.ramsey-header {
  background: linear-gradient(135deg, var(--ramsey-primary), var(--ramsey-secondary));
  color: white;
  padding: 2rem;
  border-radius: 20px;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(111, 66, 193, 0.2);
}

.ramsey-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

.ramsey-header p {
  font-size: 1.2rem;
  margin: 0;
  opacity: 0.9;
}

/* Mode selector migliorato */
.ramsey-header .mode-selector {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.ramsey-header .mode-btn {
  display: inline-flex;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(255,255,255,0.25);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid rgba(255,255,255,0.4);
  cursor: pointer;
}

.ramsey-header .mode-btn:hover {
  background: rgba(255,255,255,0.35);
  border-color: rgba(255,255,255,0.6);
  color: white;
  text-decoration: none;
}

.ramsey-header .mode-btn.active {
  background: white;
  color: var(--ramsey-primary);
  border-color: white;
}

/* Content sections */
#ramsey-home .content-section {
  display: none;
  animation: fadeIn 0.3s ease-in;
}

#ramsey-home .content-section.active {
  display: block;
}

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

/* Compile section migliorato */
#ramsey-home .compile-container {
  background: white;
  border-radius: 20px;
  border: 3px solid var(--ramsey-primary);
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(111, 66, 193, 0.1);
}

#ramsey-home .patient-data {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  border: 2px solid var(--ramsey-light);
}

#ramsey-home .patient-data h4 {
  color: var(--ramsey-primary);
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 700;
}

#ramsey-home .form-row { display: flex; gap: 1rem; margin-bottom: 1rem; }
#ramsey-home .form-group { flex: 1; }
#ramsey-home .form-label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--ramsey-primary); }
#ramsey-home .form-control { width: 100%; padding: 0.75rem; border: 2px solid #dee2e6; border-radius: 8px; font-size: 1rem; transition: all 0.3s ease; }
#ramsey-home .form-control:focus { outline: none; border-color: var(--ramsey-primary); box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.2); }

/* Scale options migliorate */
#ramsey-home .scale-section { margin-bottom: 2rem; }
#ramsey-home .scale-title { font-size: 1.4rem; font-weight: 700; color: var(--ramsey-primary); margin-bottom: 1.5rem; text-align: center; }

#ramsey-home .option-item {
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#ramsey-home .option-item:hover {
  border-color: var(--ramsey-primary);
  background: var(--ramsey-light);
  transform: translateX(5px);
  box-shadow: 0 4px 16px rgba(111, 66, 193, 0.15);
}

#ramsey-home .option-item.selected {
  border-color: var(--ramsey-primary);
  background: linear-gradient(135deg, var(--ramsey-primary), var(--ramsey-secondary));
  color: white;
  transform: translateX(10px);
  box-shadow: 0 6px 20px rgba(111, 66, 193, 0.3);
}

#ramsey-home .option-score {
  font-size: 1.5rem;
  font-weight: 700;
  margin-right: 1.5rem;
  min-width: 50px;
  text-align: center;
  background: rgba(255,255,255,0.8);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ramsey-primary);
}

#ramsey-home .option-item.selected .option-score {
  background: white;
  color: var(--ramsey-primary);
}

#ramsey-home .option-description { flex: 1; font-weight: 500; font-size: 1.1rem; }

/* Results display migliorato */
#ramsey-home .results-display {
  background: linear-gradient(135deg, var(--ramsey-primary), var(--ramsey-secondary));
  color: white;
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  margin: 2rem 0;
  display: none;
  box-shadow: 0 8px 32px rgba(111, 66, 193, 0.3);
}

#ramsey-home .results-display.show {
  display: block;
  animation: slideIn 0.5s ease-out;
}

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

#ramsey-home .result-score { font-size: 3rem; font-weight: 700; margin-bottom: 0.5rem; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
#ramsey-home .result-level { font-size: 1.5rem; margin-bottom: 1rem; }
#ramsey-home .result-description { font-size: 1.1rem; opacity: 0.9; line-height: 1.5; }

/* Action buttons migliorati */
#ramsey-home .action-buttons { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
#ramsey-home .btn { padding: 1rem 2rem; border: none; border-radius: 12px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
#ramsey-home .btn-primary { background: linear-gradient(135deg, var(--ramsey-primary), var(--ramsey-secondary)); color: white; box-shadow: 0 4px 16px rgba(111, 66, 193, 0.3); }
#ramsey-home .btn-danger { background: var(--danger); color: white; }
#ramsey-home .btn-outline-primary { background: white; color: var(--ramsey-primary); border: 2px solid var(--ramsey-primary); }
#ramsey-home .btn-outline-primary:hover { background: var(--ramsey-primary); color: white; }
#ramsey-home .btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }

/* Print template migliorato */
#ramsey-home .print-template { background: white; padding: 2rem; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
#ramsey-home .template-header { text-align: center; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 3px solid var(--ramsey-primary); }
#ramsey-home .template-title { font-size: 2rem; color: var(--ramsey-primary); margin-bottom: 0.5rem; font-weight: 700; }
#ramsey-home .template-subtitle { font-size: 1.2rem; color: #6c757d; }

/* Responsive */
@media (max-width: 768px) {
  #ramsey-home .form-row { flex-direction: column; }
  #ramsey-home .action-buttons { flex-direction: column; }
  #ramsey-home .mode-selector { justify-content: center; }
  #ramsey-home .option-item { flex-direction: column; text-align: center; }
  #ramsey-home .option-score { margin: 0 0 1rem 0; }
}

@media print {
  #ramsey-home .ramsey-header,
  #ramsey-home .mode-selector,
  #ramsey-home .action-buttons,
  #ramsey-home .print-hide { display: none !important; }
  #ramsey-home .print-template { box-shadow: none; }
  #ramsey-home .print-template .instructions,
  #ramsey-home .print-template .clinical-notes { page-break-before: avoid; }
}

