/**
 * Sovirec Playground Styles - Modern Minimal Design
 */

:root {
  --spacing-company: 0.75rem;
  --font-size: 14px;

  /* Modern color palette */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --card-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --border-radius-lg: 12px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Consistent scaling */
html {
  font-size: var(--font-size);
}

body {
  font-size: 1rem;
  background: linear-gradient(to bottom right, #fafafa, #f0f0f5);
  min-height: 100vh;
  margin: 0;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

h2 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* Tighter spacing */
.container-fluid {
  padding: var(--spacing-company);
  max-width: 100%;
}

/* Compact form elements */
label {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

button {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

small {
  font-size: 0.75rem;
}

/* Compact sections */
section {
  margin-bottom: 1.25rem;
}

/* Grid adjustments */
.grid {
  gap: 1.5rem;
}

/* Parameter Controls */
.param-group {
  margin-bottom: 1.5rem;
}

.param-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.param-value {
  font-weight: bold;
  color: var(--primary);
}

/* Recommendation Cards - Modern Design */
.recommendations-container {
  display: grid;
  gap: 1.25rem;
}

.recommendation-card {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  transition: var(--transition-smooth);
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.recommendation-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: var(--transition-smooth);
}

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

.recommendation-card:hover::before {
  opacity: 1;
}

.recommendation-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.recommendation-rank {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-gradient);
  color: white;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.recommendation-title {
  flex: 1;
}

.recommendation-title h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
  line-height: 1.4;
}

.recommendation-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.recommendation-goal {
  color: #718096;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recommendation-goal::before {
  content: '🎯';
  font-size: 1rem;
}

.recommendation-scores {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f7fafc;
  border-radius: 8px;
}

.score-item {
  flex: 1;
  text-align: center;
}

.score-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 0.25rem;
}

.score-label {
  display: block;
  font-size: 0.75rem;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recommendation-explanation {
  color: #4a5568;
  font-size: 0.9rem;
  line-height: 1.6;
  padding: 1rem;
  background: #f7fafc;
  border-radius: 8px;
  border-left: 3px solid #667eea;
}

.recommendation-explanation::before {
  content: '💡 ';
  margin-right: 0.25rem;
}

/* Badges - Enhanced */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-preferred {
  background: var(--warning-gradient);
  color: white;
  box-shadow: 0 2px 4px rgba(250, 112, 154, 0.3);
}

.badge-preferred::before {
  content: '⭐';
  margin-right: 0.375rem;
}

.badge-category {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* Category-specific colors */
.badge-category.nutrition {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.badge-category.sleep {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.badge-category.movement {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.badge-category.stress {
  background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

/* Stats Grid - Modern Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
}

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

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden;
}

.loading-content {
  background: white;
  padding: 2.5rem 3rem;
  border-radius: var(--border-radius-lg);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 90%;
}

.loading-content p {
  margin-top: 1rem;
  color: #4a5568;
  font-size: 0.9rem;
}

/* Tooltip - Minimal Elegant */
.tooltip {
  position: relative;
  display: inline-flex;
  cursor: help;
  color: #a0aec0;
  margin-left: 0.375rem;
  font-size: 0.875rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.tooltip:hover {
  opacity: 1;
}

.tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 8px);
  padding: 0.5rem 0.75rem;
  background: white;
  color: #4a5568;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  white-space: normal;
  max-width: 200px;
  min-width: 140px;
  width: max-content;
  z-index: 99999;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-align: left;
  pointer-events: none;
}

.tooltip:hover::before {
  display: none;
}

/* Config Actions */
.config-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* User Info */
.user-info {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--border-radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--card-shadow);
}

.user-info p {
  margin: 0.5rem 0;
  font-size: 0.875rem;
}

/* Navigation Bar */
nav.container-fluid {
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 1rem;
}

nav strong {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.1rem;
}

/* Main Container */
main.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Section Styling */
section {
  margin-bottom: 2rem;
}

section>h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

/* Configuration Section */
.config-section {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.config-card {
  background: #f7fafc;
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.config-card h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
}

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

.param-group {
  margin-bottom: 0;
}

.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #f7fafc;
}

.generate-btn {
  flex: 1;
  max-width: 400px;
  font-size: 1rem;
  font-weight: 600;
}

/* Profile Section */
.profile-section {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.profile-card {
  background: #f7fafc;
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.profile-avatar {
  width: 60px;
  height: 60px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.profile-info h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
}

.profile-meta {
  display: flex;
  gap: 2rem;
  font-size: 0.9rem;
  color: #718096;
}

.meta-item strong {
  color: #2d3748;
}

.profile-areas {
  font-size: 0.9rem;
  color: #4a5568;
}

.profile-areas>strong {
  display: block;
  margin-bottom: 0.75rem;
  color: #2d3748;
}

.areas-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.area-tag {
  background: white;
  border: 1px solid #cbd5e0;
  color: #4a5568;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Results Section */
.results-section {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.chart-container {
  background: #f7fafc;
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

/* Generate Button Enhancement */
button[type="submit"],
button:not(.secondary):not(.tab-button) {
  background: var(--primary-gradient);
  border: none;
  transition: var(--transition-smooth);
}

button[type="submit"]:hover,
button:not(.secondary):not(.tab-button):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Secondary buttons */
button.secondary {
  transition: var(--transition-smooth);
}

button.secondary:hover {
  transform: translateY(-1px);
}

/* Login Screen Enhancement */
/* Full-screen login wrapper */
body > div[x-show]:first-of-type {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Login container */
body > div[x-show]:first-of-type main.container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

/* Login card */
article[style*="max-width: 400px"] {
  box-shadow: var(--card-shadow-hover);
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin: 0 auto !important;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #718096;
}

.empty-state::before {
  content: '📊';
  display: block;
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Range inputs */
input[type="range"] {
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  background: var(--primary-gradient);
}

input[type="range"]::-moz-range-thumb {
  background: var(--primary-gradient);
}

/* Error Banner */
.error-banner {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  max-width: 600px;
  width: 90%;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.error-content {
  background: linear-gradient(135deg, #fc5c7d 0%, #6a82fb 100%);
  color: white;
  border-radius: var(--border-radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 8px 24px rgba(252, 92, 125, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.error-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.error-header strong {
  font-size: 1rem;
  font-weight: 600;
}

.error-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.75rem;
  line-height: 1;
  padding: 0;
  margin: 0;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-close:hover {
  opacity: 1;
  transform: none;
  box-shadow: none;
}

.error-details p {
  margin: 0.5rem 0;
  font-size: 0.875rem;
  opacity: 0.95;
}

.error-details small {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Tabs Section */
.tabs-section {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden;
  margin-bottom: 2rem;
}

.tabs-nav {
  display: flex;
  gap: 0.375rem;
  background: #f7fafc;
  padding: 0.75rem 0.75rem 0 0.75rem;
  border-bottom: 2px solid #e2e8f0;
}

.tab-button {
  flex: 1;
  padding: 0.875rem 1.25rem;
  background: transparent;
  border: 2px solid transparent !important;
  border-radius: 8px 8px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2d3748 !important;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.tab-button:hover:not(:disabled) {
  background: #e2e8f0 !important;
  color: #1a202c !important;
  transform: none !important;
  box-shadow: none !important;
}

.tab-button.active {
  background: #667eea !important;
  background-image: none !important;
  color: white !important;
  border-bottom-color: #667eea !important;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3) !important;
  font-weight: 700;
}

.tab-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: transparent !important;
  color: #cbd5e0 !important;
}

.tab-button:disabled:hover {
  transform: none !important;
  background: transparent !important;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #667eea;
  color: white;
  border-radius: 12px;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 24px;
}

.tab-button.active .tab-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.tab-content {
  padding: 2rem;
}

.tab-content .profile-section,
.tab-content .qa-section,
.tab-content .results-section {
  background: transparent;
  padding: 0;
  box-shadow: none;
  border: none;
  margin-bottom: 2rem;
}

.tab-content .profile-section:last-child,
.tab-content .qa-section:last-child,
.tab-content .results-section:last-child {
  margin-bottom: 0;
}

.tab-content h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #2d3748;
}

/* Q&A Section - Minimal */
.qa-section {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.qa-container {
  display: grid;
  gap: 1rem;
}

.qa-item {
  background: #f7fafc;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  border-left: 3px solid #667eea;
}

.qa-question {
  font-size: 0.875rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.qa-answer {
  font-size: 0.875rem;
  color: #4a5568;
  line-height: 1.5;
}

/* Stats Bar - Minimal Inline */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  background: #f7fafc;
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 1px solid #e2e8f0;
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: #667eea;
}

.stat-text {
  font-size: 0.875rem;
  color: #718096;
}

.stat-divider {
  width: 1px;
  height: 24px;
  background: #cbd5e0;
}

/* Recommendations List - Minimal Design */
.recommendations-list {
  display: grid;
  gap: 1rem;
}

.rec-item {
  display: flex;
  gap: 1rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  transition: var(--transition-smooth);
}

.rec-item:hover {
  border-color: #667eea;
  box-shadow: var(--card-shadow);
  transform: translateY(-1px);
}

.rec-number {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #667eea;
  color: white;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.875rem;
}

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

.rec-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.rec-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2d3748;
  margin: 0;
  line-height: 1.4;
}

.rec-badges {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}

.rec-badge {
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.rec-badge.badge-nutrition {
  background: #43e97b;
  color: white;
}

.rec-badge.badge-sleep {
  background: #667eea;
  color: white;
}

.rec-badge.badge-movement {
  background: #fa709a;
  color: white;
}

.rec-badge.badge-stress {
  background: #30cfd0;
  color: white;
}

.rec-badge.badge-preferred {
  background: #fbbf24;
  color: #78350f;
}

.rec-goal {
  font-size: 0.875rem;
  color: #718096;
  margin-bottom: 0.75rem;
}

.rec-explanation {
  font-size: 0.875rem;
  color: #4a5568;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.rec-score {
  font-size: 0.75rem;
  color: #667eea;
  font-weight: 600;
}