:root {
  --bg-primary: #0a1628;
  --bg-secondary: #111d32;
  --bg-card: #1a2942;
  --text-primary: #e8f1ff;
  --text-secondary: #8ba3c7;
  --accent: #00d4aa;
  --accent-hover: #00f5c4;
  --border: #2a3f5f;
  --shadow: rgba(0, 212, 170, 0.15);
  --danger: #ff6b6b;
  --warning: #ffd93d;
  --success: #00d4aa;
}

[data-theme="light"] {
  --bg-primary: #f0f5fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #1a2942;
  --text-secondary: #5a6d87;
  --accent: #00a88a;
  --accent-hover: #00c4a0;
  --border: #d0dae8;
  --shadow: rgba(0, 168, 138, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content h1 {
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 700;
}

.tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

#theme-toggle {
  width: 44px;
  height: 44px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
}

#theme-toggle::before {
  content: "🌙";
  font-size: 1.2rem;
}

[data-theme="light"] #theme-toggle::before {
  content: "☀️";
}

#theme-toggle:hover {
  border-color: var(--accent);
  transform: scale(1.1);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.hero {
  text-align: center;
  padding: 3rem 1rem;
}

.badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), #00a88a);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 40px var(--shadow);
}

.tool-icon {
  font-size: 3rem;
}

.tool-card h3 {
  font-size: 1.3rem;
  color: var(--text-primary);
}

.tool-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  flex-grow: 1;
}

.tool-cta {
  display: inline-block;
  background: var(--accent);
  color: var(--bg-primary);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.3s;
  text-align: center;
}

.tool-card:hover .tool-cta {
  background: var(--accent-hover);
}

.about {
  margin: 4rem 0;
  text-align: center;
}

.about h2 {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.trust-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.trust-item {
  padding: 1.5rem;
}

.trust-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
}

.trust-item h4 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.trust-item p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.disclaimer {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 3rem 0;
}

.disclaimer p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

/* Form Styles */
.calculator-container {
  max-width: 700px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group small {
  display: block;
  margin-top: 0.3rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.btn-primary {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  width: 100%;
  padding: 0.8rem;
  font-size: 1rem;
  font-weight: 600;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 1rem;
}

.btn-secondary:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

/* Result Styles */
.result-container {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  margin-top: 2rem;
  display: none;
}

.result-container.visible {
  display: block;
  animation: fadeIn 0.5s ease;
}

.score-display {
  text-align: center;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.score-value {
  font-size: 4rem;
  font-weight: 700;
  display: block;
}

.score-label {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.score-low { color: var(--success); }
.score-medium { color: var(--warning); }
.score-high { color: var(--danger); }

.result-details {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 1.5rem;
}

.result-details h4 {
  color: var(--accent);
  margin-bottom: 1rem;
}

.result-details ul {
  list-style: none;
}

.result-details li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-secondary);
}

.result-details li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  margin: 1rem 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s;
}

/* OSDI Question Styles */
.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.question-text {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.options-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.option-btn {
  flex: 1;
  min-width: 80px;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.option-btn:hover {
  border-color: var(--accent);
}

.option-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
}

/* Timer Styles */
.timer-display {
  text-align: center;
  padding: 3rem;
}

.timer-value {
  font-size: 6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.timer-label {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

.timer-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.timer-controls button {
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

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

@media (max-width: 768px) {
  header {
    padding: 1rem;
  }

  .header-content h1 {
    font-size: 1.2rem;
  }

  .hero h2 {
    font-size: 1.8rem;
  }

  main {
    padding: 1rem;
  }

  .timer-value {
    font-size: 4rem;
  }
}

/* Back Link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  transition: color 0.3s;
}

.back-link:hover {
  color: var(--accent);
}

.page-title {
  text-align: center;
  margin-bottom: 2rem;
}

.page-title h2 {
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.page-title p {
  color: var(--text-secondary);
}
