:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --background: #ffffff;
  --surface: #f9fafb;
  --border: #e5e7eb;
  --text: #111827;
  --text-secondary: #6b7280;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

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

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

/* Exercise List */
.exercise-list {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0;
}

.exercise-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.exercise-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.exercise-card h2 {
  margin-bottom: 0.5rem;
}

.exercise-card a {
  color: var(--primary);
  text-decoration: none;
}

.exercise-card a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.source {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.source code {
  background: var(--surface);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
}

/* Try It Now Section */
.try-it {
  background: var(--background);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem 0;
}

.try-it h3 {
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.try-it-instruction {
  margin-top: 1.5rem;
}

/* Input Groups */
.input-group {
  margin-bottom: 1.5rem;
}

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

.input-group select,
.input-group input[type="text"],
.input-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--background);
  transition: border-color 0.2s;
}

.input-group select:focus,
.input-group input[type="text"]:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-group textarea {
  min-height: 100px;
  resize: vertical;
}

.other-input {
  margin-top: 0.5rem;
}

/* Generated Output */
.generated-output {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.generated-output h4 {
  margin-bottom: 1rem;
  color: var(--text);
}

.output-display {
  display: flex;
  align-items: start;
  gap: 1rem;
}

.output-text {
  flex: 1;
  padding: 1rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Buttons */
button {
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: var(--primary-hover);
}

button:active {
  transform: translateY(1px);
}

.copy-button {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* Editor Promo */
.editor-promo {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  padding: 2rem;
  border-radius: var(--radius);
  text-align: center;
  margin: 2rem 0;
}

.editor-promo h2 {
  margin-bottom: 0.5rem;
  color: white;
}

.editor-promo p {
  margin-bottom: 1.5rem;
  opacity: 0.95;
}

.btn-primary {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: white;
  color: var(--primary);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-secondary);
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  .try-it {
    padding: 1.5rem;
  }

  .output-display {
    flex-direction: column;
  }
}

/* --- Custom Exercise Styles --- */

/* Dark theme for select dropdowns */
select, select option {
  background-color: #22223b;
  color: #fff;
}

select option {
  background-color: #22223b;
  color: #fff;
}

/* Spacing Utilities */
.mt-12 { margin-top: 12px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

.mb-10 { margin-bottom: 10px; }

.my-5 { margin: 5px 0; }
.my-10 { margin: 10px 0; }
.my-15 { margin: 15px 0; }
.my-20 { margin: 20px 0; }

/* Component Box Styles */
.box {
  padding: 15px;
  border-radius: 4px;
}

.step {
  padding-bottom: 15px;
}

/* Box Components */
.tips-box, .test-tips, .example-output, .log-analysis-tips, .best-practices, .knowledge-check {
  margin-top: 20px;
  padding: 15px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
}

/* Header Styles in Boxes */
.tips-box h4,
.test-tips h4,
.example-output h5,
.best-practices h5,
.log-analysis-tips h4 {
  margin-top: 0;
}

/* Code & Monospace Text */
.monospace {
  font-family: monospace;
  font-size: 0.9em;
}

/* Prompt Container */
.prompt-container {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  position: relative;
}

.prompt-container pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text);
  margin: 0;
}

/* Copy Button - Sticky */
.copy-btn {
  position: sticky;
  top: 10px;
  float: right;
  z-index: 1;
  margin-left: 10px;
  margin-bottom: 5px;
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary);
  padding: 6px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
  font-family: 'Arial', sans-serif;
}

.copy-btn:hover {
  background: var(--primary-hover);
}

.copy-btn.copied {
  background-color: #28a745;
  border-color: #28a745;
}

/* Link Buttons */
.gemini-link-button {
  display: block;
  background: var(--primary);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  margin-top: 20px;
  transition: all 0.2s ease-in-out;
  box-shadow: var(--shadow);
}

.gemini-link-button:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.gemini-link {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-weight: bold;
  margin-left: 10px;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gemini-link:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Completion Button */
.completion-btn {
  display: block;
  width: 100%;
  margin-top: 30px;
  background: var(--primary);
  border: 1px solid var(--primary);
  color: white;
  padding: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  font-weight: bold;
}

.completion-btn:hover {
  background: var(--primary-hover);
}

.completion-btn-final {
  background: #28a745;
  border-color: #28a745;
}

.completion-btn-final:hover {
  background: #218838;
}

/* Interactive Elements */
.example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.example-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  text-align: center;
}

.example-btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.03);
}

/* Feedback Messages */
.feedback {
  padding: 15px;
  border-radius: 8px;
  margin-top: 25px;
  display: none;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.feedback.correct {
  background: #e8f5e9;
  border: 1px solid #4caf50;
  color: #1b5e20;
}

.feedback.incorrect {
  background: #ffebee;
  border: 1px solid #f44336;
  color: #b71c1c;
}

.feedback ul {
  list-style-position: inside;
  padding-left: 0;
}

/* Question Prompt */
.question-prompt {
  text-align: center;
  font-weight: bold;
  margin-bottom: 15px;
  font-size: 1.1em;
}

/* Custom Input Styles */
#industryInput {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  color: var(--text);
  font-size: 16px;
  margin-top: 8px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

#industryInput::placeholder {
  color: var(--text-secondary);
}

#industryInput:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Builder Step Styles */
.builder-step p.example {
  font-style: italic;
  background: var(--surface);
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  border: 1px solid var(--border);
}

.builder-step ul {
  list-style-position: inside;
  margin-left: 5px;
}

.builder-step li {
  margin-bottom: 8px;
}

/* Tool Links */
.tool-links {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.tool-link-button {
  flex: 1;
  min-width: 200px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 15px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  transition: all 0.2s ease-in-out;
}

.tool-link-button:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* RICE Table */
.rice-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.rice-table th,
.rice-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.rice-table th {
  font-size: 12px;
  text-transform: uppercase;
  background: var(--surface);
}

.rice-table input {
  padding: 6px;
  max-width: 80px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.rice-table .final-score {
  font-weight: bold;
  font-size: 1.1em;
  color: var(--primary);
}
