/* ==========================================================================
   Shared projects (showcase + detail) theme
   Base (no class) = light theme. The shared inline toggle script adds
   body.dark-mode on load by default, so visitors see the dark theme first;
   clicking the toggle removes the class to reveal the light theme.
   ========================================================================== */

:root {
  --cyan: #00E5FF;
  --violet: #7C5CFF;
  --gradient: linear-gradient(135deg, var(--cyan), var(--violet));
  --accent-3: #f4a261;
  --danger: #e5484d;
  --good: #2DD4BF;

  /* light (base) */
  --bg: #F5F7FA;
  --bg-raised: #ffffff;
  --bg-panel: rgba(10, 20, 35, 0.035);
  --border-glass: rgba(10, 20, 35, 0.1);
  --border-glass-hover: rgba(0, 172, 193, 0.55);
  --ink: #171b21;
  --ink-soft: #4a5568;
  --ink-dim: #7c8695;
  --accent: #0aa7c9;
  --accent-2: #6c46e0;
}

body.dark-mode {
  --bg: #0D1117;
  --bg-raised: #11161d;
  --bg-panel: rgba(255, 255, 255, 0.035);
  --border-glass: rgba(255, 255, 255, 0.09);
  --border-glass-hover: rgba(0, 229, 255, 0.5);
  --ink: #E6EDF3;
  --ink-soft: #A0AEC0;
  --ink-dim: #6b7684;
  --accent: var(--cyan);
  --accent-2: var(--violet);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--ink);
  transition: background 0.3s, color 0.3s;
  background-image:
    linear-gradient(rgba(10, 20, 35, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 20, 35, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
}
body.dark-mode {
  background-image:
    linear-gradient(rgba(124, 92, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 92, 255, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
}

a { color: inherit; }

/* ---------- top bar ---------- */
.projects-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 6%;
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  background: rgba(245, 247, 250, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 20;
}
body.dark-mode .projects-topbar {
  background: rgba(13, 17, 23, 0.82);
}
.projects-brand {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.projects-brand i {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.back-home {
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  color: var(--ink-soft);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.back-home:hover { border-color: var(--border-glass-hover); color: var(--ink); background: rgba(0, 229, 255, 0.08); }
.theme-toggle-projects {
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, transform 0.3s;
}
.theme-toggle-projects:hover { border-color: var(--border-glass-hover); transform: rotate(15deg); }

/* ---------- showcase hero ---------- */
.showcase-hero { padding: 48px 6% 20px; max-width: 900px; }
.showcase-hero h1 {
  font-size: 2.1rem;
  margin-bottom: 8px;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.showcase-hero p { color: var(--ink-soft); line-height: 1.6; }

/* ---------- grid ---------- */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 26px;
  padding: 12px 6% 70px;
}
.showcase-card {
  text-decoration: none;
  color: inherit;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
}
.showcase-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glass-hover);
  box-shadow: 0 16px 36px rgba(0, 229, 255, 0.16);
}
.showcase-card .thumb-wrap { height: 170px; overflow: hidden; background: #060a0f; }
.showcase-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.showcase-card .card-body { padding: 16px 18px 20px; flex: 1; display: flex; flex-direction: column; }
.showcase-card h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--ink); }
.showcase-card p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); line-height: 1.5; flex: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  font-size: 0.7rem;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(0, 229, 255, 0.12);
  color: var(--accent);
  font-weight: 600;
}
.card-cta { margin-top: 14px; font-size: 0.85rem; font-weight: 600; color: var(--accent-2); }

/* ---------- detail page ---------- */
.detail-wrap { max-width: 880px; margin: 0 auto; padding: 44px 6% 80px; }
.detail-title {
  font-size: 2.1rem;
  margin: 6px 0 10px;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.detail-tagline { color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 22px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }

.detail-links { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 34px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 9px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-github { background: var(--ink); color: var(--bg); }
body.dark-mode .btn-github { background: #e6edf3; color: #05070a; }
.btn-live { background: var(--gradient); color: #05070a; }
.btn-live:hover { box-shadow: 0 10px 24px rgba(0, 229, 255, 0.3); }

.detail-section { margin-bottom: 36px; }
.detail-section h2 {
  font-size: 1.25rem;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid transparent;
  border-image: var(--gradient) 1;
  display: inline-block;
  font-weight: 700;
  color: var(--ink);
}
.detail-section p { line-height: 1.75; color: var(--ink-soft); margin: 0 0 12px; }

.sim-box {
  background: #060a0f;
  border-radius: 14px;
  padding: 22px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-glass);
}
.sim-box video { width: 100%; border-radius: 8px; }
.sim-note { margin-top: 14px; font-size: 0.78rem; color: var(--ink-dim); text-align: center; }

.sample-carousel { display: flex; flex-direction: column; gap: 12px; }
.sample-main-wrap { display: flex; align-items: center; gap: 10px; }
.sample-main-img-wrap {
  flex: 1;
  height: 360px;
  border-radius: 12px;
  overflow: hidden;
  background: #060a0f;
  border: 1px solid var(--border-glass);
}
.sample-main-img-wrap img { width: 100%; height: 100%; object-fit: contain; background: #060a0f; display: block; }
.sample-arrow {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: var(--bg-panel);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--ink);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.sample-arrow:hover { background: var(--gradient); color: #05070a; border-color: transparent; }
.sample-caption-bar { font-size: 0.85rem; color: var(--ink-soft); text-align: center; min-height: 1.4em; }
.sample-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.sample-thumb {
  flex: 0 0 76px;
  height: 54px;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #060a0f;
  opacity: 0.6;
  transition: opacity 0.2s, border-color 0.2s;
}
.sample-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sample-thumb:hover { opacity: 0.85; }
.sample-thumb.active { opacity: 1; border-color: var(--accent); }

@media (max-width: 560px) {
  .sample-main-img-wrap { height: 220px; }
  .sample-arrow { width: 34px; height: 34px; }
}

.ad-slot {
  margin: 40px 0;
  padding: 10px;
  border: 1px dashed var(--border-glass);
  border-radius: 8px;
  text-align: center;
  font-size: 0.7rem;
  color: var(--ink-dim);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-footer-nav {
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid var(--border-glass);
}
.detail-footer-nav a { color: var(--accent-2); text-decoration: none; font-weight: 600; }

/* ---------- interactive sim widgets ---------- */
.spyder-controls { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.spyder-controls button {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}
.spyder-controls button.active { background: var(--gradient); color: #05070a; border-color: transparent; }

.janata-demo { width: 100%; max-width: 420px; }
.janata-demo textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  background: #0b0f14;
  color: #e6e9ee;
  padding: 10px;
  font-family: inherit;
  resize: none;
}
.janata-demo button {
  margin-top: 10px;
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  background: var(--gradient);
  color: #05070a;
  cursor: pointer;
  font-weight: 700;
}
.janata-status { margin-top: 14px; font-size: 0.85rem; color: var(--ink-soft); }
.janata-status .step { opacity: 0.35; transition: opacity 0.3s; }
.janata-status .step.active { opacity: 1; color: var(--good); font-weight: 600; }

.citc-frame-wrap { width: 100%; }
.citc-frame-wrap iframe { width: 100%; height: 320px; border: 1px solid var(--border-glass); border-radius: 8px; }
