:root {
  --bg-color: #0f172a;
  --text-color: #f8fafc;
  --primary-color: #ec4899;
  --secondary-color: #8b5cf6;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
}

/* Theme classes added to body via JS */
body.theme-mild {
  --primary-color: #10b981;
  --secondary-color: #3b82f6;
}

body.theme-nuclear {
  --primary-color: #ef4444;
  --secondary-color: #f97316;
  --bg-color: #2a0f0f;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-color);
  background-image: 
    radial-gradient(at 0% 0%, rgba(236, 72, 153, 0.15) 0px, transparent 50%), /* fallback */
    radial-gradient(at 0% 0%, color-mix(in srgb, var(--primary-color) 15%, transparent) 0px, transparent 50%),
    radial-gradient(at 100% 100%, color-mix(in srgb, var(--secondary-color) 15%, transparent) 0px, transparent 50%);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  transition: background-color 0.5s, --primary-color 0.5s, --secondary-color 0.5s;
}

.container {
  max-width: 800px; /* Expanded for chart */
  width: 100%;
  text-align: center;
}

header h1 {
  font-size: 3rem;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  color: transparent;
  margin-bottom: 10px;
  transition: all 0.5s;
}

header p {
  color: #94a3b8;
  margin-bottom: 30px;
}

.controls-box {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 30px;
}

.search-box {
  display: flex;
  gap: 10px;
}

.spice-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #94a3b8;
}

.spice-selector select {
  background: rgba(15, 23, 42, 0.6);
  color: white;
  border: 1px solid var(--glass-border);
  padding: 8px 12px;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.3s;
}

.spice-selector select:focus {
  border-color: var(--primary-color);
}

input {
  flex: 1;
  padding: 15px 20px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(15, 23, 42, 0.6);
  color: white;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}

input:focus {
  border-color: var(--primary-color);
}

button {
  padding: 15px 30px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  color: white;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.5s;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px var(--primary-color);
}

button:active {
  transform: translateY(0);
}

.icon-btn {
  padding: 8px 12px;
  font-size: 0.8rem;
  background: rgba(255,255,255,0.1);
  margin-left: auto;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.5s ease forwards;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  text-align: left;
}

#avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--primary-color);
  transition: border-color 0.5s;
}

.profile-info h2 {
  font-size: 1.5rem;
  margin-bottom: 2px;
}

.profile-info a {
  color: var(--secondary-color);
  text-decoration: none;
  font-size: 0.9rem;
}

.account-age {
  color: #94a3b8;
  font-size: 0.8rem;
  margin-top: 4px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
  padding: 20px 0;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
}

.stats-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  align-content: center;
}

.chart-column {
  position: relative;
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.stat {
  display: flex;
  flex-direction: column;
  color: #94a3b8;
  font-size: 0.875rem;
  background: rgba(0,0,0,0.2);
  padding: 15px;
  border-radius: 12px;
}

.stat span {
  color: var(--text-color);
  font-size: 1.5rem;
  font-weight: 800;
}

.roast-content {
  text-align: left;
  background: rgba(0,0,0,0.2);
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid var(--primary-color);
  transition: border-color 0.5s;
}

.roast-content h3 {
  margin-bottom: 10px;
  color: var(--primary-color);
  transition: color 0.5s;
}

#roast-text {
  font-size: 1.1rem;
  line-height: 1.6;
  font-style: italic;
}

.hidden {
  display: none !important;
}

#error-msg {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  padding: 15px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--glass-border);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

@media (max-width: 600px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
