/* styles.css */
* { box-sizing: border-box; } /* REMOVED 'transition: all' */

html {
  scroll-behavior: smooth;
}
body {
  font-family: 'Poppins', sans-serif;
  min-height: 100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:20px;
  margin:0;
  /* ADDED specific transitions */
  transition: background 0.25s ease, color 0.25s ease;
}

/* LIGHT THEME */
body.light {
  background: linear-gradient(135deg,#e3f2fd,#ffffff);
  color:#1a1a1a;
}
body.light .container {
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}
body.light textarea { background:#f8f9fa; color:#222; border:1px solid #d9d9d9; }
body.light .output { background:#f1f3f4; color:#1a1a1a; border:1px solid #d9d9d9; }

/* DARK THEME */
body.dark {
  background: linear-gradient(135deg,#141e30,#243b55);
  color:#f8f9fa;
}
body.dark .container {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
body.dark textarea { background:#1e1e2f; color:#00ff88; border:1px solid #222;}
body.dark .output { background:#0d1117; color:#00ff88; border:1px solid #222; }

/* Layout */
h1 {
  font-size:2rem;
  margin-bottom:20px;
  background: linear-gradient(to right, #00c6ff,#0072ff);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
}

h1 + .description {
  margin-top: -10px;
  margin-bottom: 25px;
  font-size: 1.05rem;
  opacity: 0.9;
  text-align: center;
  max-width: 550px;
  padding-left: 15px;
  padding-right: 15px;
}

.container{
  width:100%;
  max-width:900px;
  border-radius:12px;
  padding:22px;
  /* ADDED specific transitions */
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
h2{font-size:1.05rem; margin:0 0 8px 0; color:inherit;}
textarea{
  width:100%; height:250px; border-radius:8px; padding:12px 14px;
  font-family:'Consolas',monospace; font-size:14px; outline:none; resize:vertical;
  /* ADDED specific transitions */
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* Main 'Run' button */
button{
  background: linear-gradient(90deg,#0072ff,#00c6ff);
  color:white; border:none; border-radius:8px; padding:10px 18px;
  font-size:15px; font-weight:600; cursor:pointer; margin-top:12px;
  /* ADDED specific transitions */
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
button:hover{ transform:scale(1.03); box-shadow:0 6px 18px rgba(0,114,255,0.25); }

.output{
  margin-top:16px; border-radius:8px; font-family:'Consolas',monospace;
  min-height:80px; white-space:pre-wrap; overflow:auto; padding:14px;
  font-size: 15px;
  /* ADDED specific transitions */
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* Output state classes */
.output--success { color: var(--output-success); }
.output--error   { color: var(--output-error); }
.output--info    { color: var(--output-info); }

body.light { --output-success: #0a6d1b; --output-error:#b22222; --output-info:#036b95; }
body.dark  { --output-success: #00ff88; --output-error:#ff4d4d; --output-info:#00b4d8; }

/* Theme toggle */
.theme-toggle { position: absolute; top:20px; right:20px; display:flex;align-items:center;gap:10px; cursor:pointer; user-select:none;}
.toggle-btn{ width:46px; height:24px; background:#ccc; border-radius:12px; position:relative; }
.toggle-btn::after{ content:''; width:20px; height:20px; background:#fff; border-radius:50%; position:absolute; top:2px; left:2px; transition:transform .25s; } /* Kept specific transition */
body.dark .toggle-btn{ background:#0072ff; }
body.dark .toggle-btn::after{ transform: translateX(22px); }

/* --- MODIFIED & NEW STYLES BELOW --- */

/* Action buttons container */
.actions-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.actions-container button {
  margin-top: 0; 
  flex-grow: 1;
  flex-basis: 150px;
}

@media (max-width: 500px) {
  #runButton {
    flex-basis: 100%;
    order: -1;
  }
}

.actions-container + h2 {
  margin-top: 24px;
}

/* Tutorial Button Style (Outline) */
.tutorial-btn {
  background: transparent;
  border: 2px solid #0072ff;
  color: #0072ff;
  padding: 8px 16px; 
  /* transition is inherited from 'button' */
}
.tutorial-btn:hover {
  background: #0072ff;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0,114,255,0.25);
}

/* Modal Styles */
.modal {
  display: none; 
  position: fixed; 
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: auto; 
  background-color: rgba(0,0,0,0.6); 
  backdrop-filter: blur(5px);
  padding-top: 60px;
  padding-left: 10px;
  padding-right: 10px;
  /* Do NOT add transition here */
}

body.modal-open {
  overflow: hidden; 
}

.modal-content {
  margin: 5% auto;
  padding: 20px 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  position: relative;
  /* ADDED specific transitions */
  transition: background 0.25s ease, border-color 0.25s ease;
}
.modal-content-large {
  max-width: 800px;
}

.modal-content h2 { margin-top: 0; }
.modal-content h3 { margin-top: 20px; }
.modal-content p { line-height: 1.6; opacity: 0.9; }

/* Modal Theme */
body.light .modal-content {
  background: #fff;
  border: 1px solid #ddd;
}
body.dark .modal-content {
  background: #1e1e2f;
  border: 1px solid #333;
}

/* Modal Code Sample Box */
pre.code-sample {
  padding: 12px;
  border-radius: 8px;
  white-space: pre-wrap;
  font-size: 0.9rem;
  /* ADDED specific transitions */
  transition: background 0.25s ease;
}
body.light pre.code-sample { background: #f1f3f4; }
body.dark pre.code-sample { background: #0d1117; }

/* Modal Close Button */
.close-btn {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  /* ADDED specific transitions */
  transition: color 0.25s ease;
}
.close-btn:hover,
.close-btn:focus {
  color: #ff4d4d;
  text-decoration: none;
}

/* small helpers */
.output--empty { color: #999; font-style:italic; }
footer { margin-top:18px; font-size:0.9rem; opacity:0.8; color:inherit; }

/* NEW: Choice Container */
.choice-container {
  display: flex;
  gap: 20px;
  width: 100%;
  max-width: 900px;
  margin-bottom: 20px;
}

.choice-card {
  flex: 1;
  border-radius: 12px;
  padding: 20px 24px;
  cursor: pointer;
  transition: all 0.2s ease; /* This one is fine as it's self-contained */
  border: 1px solid transparent;
}
.choice-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.2rem;
}
.choice-card p {
  margin-bottom: 12px;
  opacity: 0.8;
  font-size: 0.95rem;
}
.choice-card span {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Light theme cards */
body.light .choice-card {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
body.light .choice-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.07);
}
body.light .choice-card h3 { color: #0072ff; }
body.light .choice-card span { color: #333; }

/* Dark theme cards */
body.dark .choice-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
body.dark .choice-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}
body.dark .choice-card h3 { color: #00c6ff; }
body.dark .choice-card span { color: #f1f1f1; }

/* NEW: Modal Link Button */
.modal-link-button {
  display: inline-block;
  background: linear-gradient(90deg,#0072ff,#00c6ff);
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  margin-bottom: 16px;
  transition: all 0.2s ease; /* This one is fine */
}
.modal-link-button:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 18px rgba(0,114,255,0.25);
}

@media (max-width: 700px) {
  .choice-container {
    flex-direction: column;
  }
  h1 {
    text-align: center;
  }
}

/* --- NEW: STYLES FOR COMMAND BLOCK AND COPY BUTTON --- */

.modal-content p {
  margin-bottom: 8px;
}

.command-block {
  position: relative;
  margin: 12px 0 20px 0;
  border-radius: 8px;
  overflow: hidden;
  /* ADDED specific transitions */
  transition: background 0.25s ease, border-color 0.25s ease;
}

.command-block pre {
  margin: 0;
  padding: 12px 16px;
  white-space: pre-wrap;
  font-family: 'Consolas', monospace;
  font-size: 0.9rem;
  padding-right: 50px;
  /* ADDED specific transitions */
  transition: color 0.25s ease;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 5px 9px;
  margin: 0;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.7;
  transition: all 0.2s ease; /* This one is fine */
}

.copy-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
  box-shadow: none;
}

.copy-btn .fa-copy {
  display: inline;
}

.copy-btn .fa-check {
  display: none;
  color: #00ff88;
}

.copy-btn.copied {
  background: rgba(0, 255, 136, 0.15);
  border-color: rgba(0, 255, 136, 0.3);
}

.copy-btn.copied .fa-copy {
  display: none;
}
.copy-btn.copied .fa-check {
  display: inline;
}


/* Light Mode: Fix for command block and copy button */
body.light .command-block {
  background: #f1f3f4;
  border: 1px solid #d9d9d9;
}
body.light .command-block pre {
  color: #1a1a1a;
}
body.light .copy-btn {
  background: rgba(0, 0, 0, 0.05);
  color: #333;
  border: 1px solid #ccc;
  opacity: 0.8;
}
body.light .copy-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}
body.light .copy-btn.copied {
  background: rgba(10, 109, 27, 0.1);
  border-color: rgba(10, 109, 27, 0.3);
}
body.light .copy-btn.copied .fa-check {
  color: #0a6d1b;
}

/* NEW: Divider in modal */
.modal-divider {
  border: none;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.1);
  margin: 30px 0;
  /* ADDED specific transitions */
  transition: background-color 0.25s ease;
}
body.light .modal-divider {
  background-color: #eee;
}

