/* ============================================================
   SATR DESIGN SYSTEM & COMPONENTS (CSS)
   Arabic-First Developer Community
   ============================================================ */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm, 8px);
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-md, 12px);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1.2;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm, 6px);
}

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg, 18px);
}

.btn-primary {
  background-color: var(--primary, #00d68f);
  color: #000;
  box-shadow: 0 4px 14px rgba(0, 214, 143, 0.3);
  font-weight: 800;
}

.btn-primary:hover {
  background-color: #00f0a0;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 214, 143, 0.45);
}

.btn-secondary {
  background-color: var(--bg-surface-2, #1a2438);
  color: var(--text-primary, #f0f6ff);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
}

.btn-secondary:hover {
  background-color: var(--bg-hover, #1e2d45);
  border-color: rgba(255,255,255,0.15);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary, #00d68f);
  border: 1px solid var(--primary, #00d68f);
}

.btn-outline:hover {
  background-color: rgba(0, 214, 143, 0.12);
}

.btn-blue {
  background-color: var(--blue, #38bdf8);
  color: #000;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

.btn-blue:hover {
  background-color: #7dd3fc;
  transform: translateY(-2px);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-secondary, #8899b4);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: var(--radius-md, 12px);
  color: var(--text-primary, #f0f6ff);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary, #00d68f);
  box-shadow: 0 0 0 3px rgba(0, 214, 143, 0.2);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

/* Cards & Containers */
.card {
  background-color: var(--bg-surface, #111827);
  border-radius: var(--radius-lg, 18px);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.glass-panel {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Badges & Tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background-color: var(--bg-surface-2, #1a2438);
  color: var(--text-secondary, #8899b4);
  border-radius: var(--radius-full, 9999px);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
  text-decoration: none;
}

.tag-primary {
  background: rgba(0, 214, 143, 0.12);
  color: var(--primary, #00d68f);
  border-color: rgba(0, 214, 143, 0.25);
}

.tag-blue {
  background: rgba(56, 189, 248, 0.12);
  color: var(--blue, #38bdf8);
  border-color: rgba(56, 189, 248, 0.25);
}

.tag-violet {
  background: rgba(167, 139, 250, 0.12);
  color: var(--violet, #a78bfa);
  border-color: rgba(167, 139, 250, 0.25);
}

.tag-orange {
  background: rgba(251, 146, 60, 0.12);
  color: var(--orange, #fb923c);
  border-color: rgba(251, 146, 60, 0.25);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--bg-surface, #111827);
  border-radius: var(--radius-xl, 24px);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
  margin: auto;
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted, #4d637f);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.modal-close:hover {
  color: var(--text-primary, #f0f6ff);
  background: var(--bg-hover, #1e2d45);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: var(--bg-surface, #111827);
  color: var(--text-primary, #f0f6ff);
  padding: 12px 20px;
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--primary, #00d68f);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 214, 143, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ============================================================
   PROJECTS SHOWCASE & DETAILS STYLES
   ============================================================ */

.projects-hero {
  background: linear-gradient(135deg, rgba(0, 214, 143, 0.08) 0%, rgba(56, 189, 248, 0.08) 100%);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-xl, 24px);
  padding: 32px 28px;
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.projects-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(0,214,143,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.projects-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.filter-chips-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-chip {
  padding: 6px 14px;
  border-radius: var(--radius-full, 9999px);
  background: var(--bg-surface, #111827);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  color: var(--text-secondary, #8899b4);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-chip:hover {
  border-color: var(--primary, #00d68f);
  color: var(--text-primary, #f0f6ff);
}

.filter-chip.active {
  background: rgba(0, 214, 143, 0.15);
  color: var(--primary, #00d68f);
  border-color: var(--primary, #00d68f);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

.project-card {
  background: var(--bg-surface, #111827);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-lg, 18px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 214, 143, 0.35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.project-cover-container {
  position: relative;
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--bg-surface-2, #1a2438), #0c1424);
  overflow: hidden;
}

.project-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .project-cover-img {
  transform: scale(1.04);
}

.project-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, #132035, #1e2c45);
}

.project-badge-top {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.75rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.project-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-primary, #f0f6ff);
}

.project-card-tagline {
  font-size: 0.88rem;
  color: var(--text-secondary, #8899b4);
  line-height: 1.5;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.project-card-author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
}

.project-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full, 9999px);
  object-fit: cover;
}

.project-author-info {
  flex: 1;
  min-width: 0;
}

.project-author-name {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.project-card-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted, #4d637f);
}

/* ============================================================
   PROJECT DETAILS PAGE (project.html)
   ============================================================ */

.project-page-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

.project-header-card {
  background: var(--bg-surface, #111827);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-xl, 24px);
  padding: 28px;
  margin-bottom: 24px;
}

.project-gallery-container {
  margin-bottom: 28px;
}

.project-gallery-main {
  width: 100%;
  height: 380px;
  border-radius: var(--radius-lg, 18px);
  overflow: hidden;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.project-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-thumbnails-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.project-thumb {
  width: 90px;
  height: 60px;
  border-radius: var(--radius-md, 12px);
  border: 2px solid transparent;
  cursor: pointer;
  object-fit: cover;
  opacity: 0.7;
  transition: all 0.2s;
  flex-shrink: 0;
}

.project-thumb.active, .project-thumb:hover {
  opacity: 1;
  border-color: var(--primary, #00d68f);
  transform: scale(1.02);
}

.feedback-section {
  background: var(--bg-surface, #111827);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-xl, 24px);
  padding: 28px;
}

.feedback-item {
  padding: 16px;
  background: var(--bg-surface-2, #1a2438);
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: var(--radius-md, 12px);
  margin-bottom: 14px;
}

.feedback-type-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full, 9999px);
  font-weight: 700;
}

/* ============================================================
   CODE EXPERIENCE & SNIPPET STUDIO (code.html & Platform-wide)
   ============================================================ */

.code-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 28px;
  padding: 28px 32px;
  background: linear-gradient(135deg, rgba(0, 214, 143, 0.08) 0%, rgba(56, 189, 248, 0.05) 50%, rgba(167, 139, 250, 0.05) 100%);
  border: 1px solid rgba(0, 214, 143, 0.2);
  border-radius: var(--radius-xl, 24px);
  position: relative;
  overflow: hidden;
}

.code-hero::before {
  content: '';
  position: absolute;
  top: -80px;
  left: -80px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(0, 214, 143, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.code-hero-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.code-hero h1 {
  font-size: 1.9rem;
  font-weight: 900;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 40%, var(--primary, #00d68f) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.code-hero p {
  color: var(--text-secondary, #8899b4);
  font-size: 0.98rem;
  max-width: 620px;
  line-height: 1.6;
}

/* Studio Nav Mode Switcher */
.code-mode-switcher {
  display: flex;
  gap: 8px;
  background: var(--bg-surface, #111827);
  padding: 6px;
  border-radius: var(--radius-lg, 18px);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  margin-bottom: 24px;
}

.code-mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-md, 12px);
  border: none;
  background: transparent;
  color: var(--text-secondary, #8899b4);
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  transition: all var(--transition, 0.2s);
}

.code-mode-btn:hover {
  color: var(--text-primary, #f0f6ff);
  background: var(--bg-hover, #1e2d45);
}

.code-mode-btn.active {
  background: linear-gradient(135deg, rgba(0, 214, 143, 0.2), rgba(56, 189, 248, 0.15));
  color: var(--primary, #00d68f);
  border: 1px solid rgba(0, 214, 143, 0.3);
  box-shadow: 0 4px 16px rgba(0, 214, 143, 0.15);
}

/* Code Studio Layout */
.code-studio-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

.code-editor-box {
  background: #0b111e;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: var(--radius-xl, 24px);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.code-editor-header {
  background: #131d2e;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  gap: 12px;
  flex-wrap: wrap;
}

.editor-window-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.window-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.window-dot.red { background: #ef4444; }
.window-dot.yellow { background: #f59e0b; }
.window-dot.green { background: #10b981; }

.code-editor-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.editor-lang-select {
  background: var(--bg-surface, #111827);
  border: 1px solid var(--border, rgba(255,255,255,0.15));
  color: var(--text-primary, #f0f6ff);
  padding: 6px 12px;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  direction: ltr;
}

.editor-lang-select:focus {
  border-color: var(--primary, #00d68f);
}

.editor-quick-templates {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.template-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full, 9999px);
  color: var(--text-secondary, #8899b4);
  font-size: 0.78rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.template-chip:hover {
  background: var(--primary-dim, rgba(0, 214, 143, 0.15));
  color: var(--primary, #00d68f);
  border-color: rgba(0, 214, 143, 0.3);
}

/* Code Editor Textarea Area */
.code-editor-wrapper {
  display: flex;
  min-height: 400px;
  max-height: 600px;
  position: relative;
  background: #080d16;
  font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Consolas', monospace;
  direction: ltr;
  text-align: left;
  overflow: hidden;
}

.code-line-numbers {
  padding: 16px 12px;
  background: #0c121d;
  color: var(--text-muted, #4d637f);
  text-align: right;
  user-select: none;
  font-size: 0.9rem;
  line-height: 1.65;
  border-right: 1px solid rgba(255,255,255,0.06);
  min-width: 48px;
  font-family: inherit;
  overflow: hidden;
}

.code-textarea {
  flex: 1;
  padding: 16px 18px;
  background: transparent;
  color: #f1f5f9;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.65;
  resize: none;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
  caret-color: var(--primary, #00d68f);
}

.code-editor-footer {
  background: #0f1726;
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
  font-size: 0.82rem;
  color: var(--text-muted, #4d637f);
  direction: ltr;
}

.editor-status-items {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* Live Playground / Runner Pane */
.code-runner-pane {
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
  background: #080d16;
  display: flex;
  flex-direction: column;
}

.runner-pane-header {
  background: #111a2a;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
}

.runner-tabs {
  display: flex;
  gap: 6px;
}

.runner-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary, #8899b4);
  padding: 6px 12px;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.runner-tab.active {
  background: var(--bg-hover, #1e2d45);
  color: var(--primary, #00d68f);
}

.runner-output-box {
  padding: 14px;
  min-height: 160px;
  max-height: 280px;
  overflow: auto;
}

.code-preview-frame {
  width: 100%;
  height: 240px;
  background: #ffffff;
  border-radius: var(--radius-md, 12px);
  border: none;
}

.code-console-output {
  background: #020617;
  border-radius: var(--radius-md, 12px);
  padding: 14px;
  font-family: 'Fira Code', 'Consolas', monospace;
  direction: ltr;
  color: #38bdf8;
  font-size: 0.88rem;
  min-height: 140px;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  border: 1px solid rgba(255,255,255,0.05);
}

.console-log-line {
  margin-bottom: 6px;
  line-height: 1.5;
  display: flex;
  gap: 8px;
}
.console-log-line.error { color: #f87171; }
.console-log-line.warn { color: #fbbf24; }
.console-log-line.info { color: #38bdf8; }
.console-log-line.success { color: #34d399; }

/* Publish / Sidebar Card */
.studio-side-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.studio-card {
  background: var(--bg-surface, #111827);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-lg, 18px);
  padding: 20px;
}

.studio-card-title {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary, #f0f6ff);
}

/* Snippet Cards in Hub */
.snippets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.snippet-card {
  background: var(--bg-surface, #111827);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-xl, 24px);
  padding: 20px;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.snippet-card:hover {
  border-color: rgba(0, 214, 143, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 15px rgba(0, 214, 143, 0.08);
  transform: translateY(-3px);
}

.snippet-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.snippet-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.snippet-author-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full, 9999px);
  border: 2px solid var(--border, rgba(255,255,255,0.1));
}

.snippet-author-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary, #f0f6ff);
}

.snippet-date {
  font-size: 0.76rem;
  color: var(--text-muted, #4d637f);
}

.snippet-card-title {
  font-size: 1.12rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-primary, #f0f6ff);
  line-height: 1.4;
  cursor: pointer;
  transition: color 0.15s;
}

.snippet-card-title:hover {
  color: var(--primary, #00d68f);
}

.snippet-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary, #8899b4);
  margin-bottom: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.snippet-code-preview {
  background: #060b13;
  border-radius: var(--radius-md, 12px);
  padding: 14px;
  margin: 10px 0 14px;
  direction: ltr;
  text-align: left;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  max-height: 180px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  position: relative;
  cursor: pointer;
}

.snippet-code-preview::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(to bottom, transparent, #060b13);
  pointer-events: none;
}

.snippet-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.snippet-tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full, 9999px);
  padding: 2px 8px;
  font-size: 0.74rem;
  color: var(--text-muted, #4d637f);
}

.snippet-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.05));
}

.snippet-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  color: var(--text-secondary, #8899b4);
  padding: 6px 12px;
  border-radius: var(--radius-md, 12px);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.snippet-action-btn:hover {
  background: var(--bg-hover, #1e2d45);
  color: var(--text-primary, #f0f6ff);
}

.snippet-action-btn.upvoted {
  background: var(--primary-dim, rgba(0, 214, 143, 0.15));
  color: var(--primary, #00d68f);
  border-color: rgba(0, 214, 143, 0.3);
}

/* Syntax Highlighting & Code Block styling across Satr */
.satr-code-block {
  background: #080d16;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg, 18px);
  overflow: hidden;
  margin: 14px 0;
  position: relative;
  direction: ltr;
  text-align: left;
}

.satr-code-header {
  background: #111a28;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.satr-lang-badge {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary, #00d68f);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.satr-code-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.satr-copy-btn, .satr-open-studio-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary, #8899b4);
  padding: 4px 10px;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
  font-family: 'Tajawal', sans-serif;
  direction: rtl;
}

.satr-copy-btn:hover, .satr-open-studio-btn:hover {
  background: var(--bg-hover, #1e2d45);
  color: var(--text-primary, #f0f6ff);
}

.satr-copy-btn.copied {
  background: rgba(0, 214, 143, 0.2);
  color: var(--primary, #00d68f);
  border-color: rgba(0, 214, 143, 0.4);
}

.satr-code-pre {
  padding: 16px;
  margin: 0;
  overflow-x: auto;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #e2e8f0;
}

/* Modal for Snippet Details & Discussion */
.code-modal-content {
  max-width: 880px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}

.code-discussion-box {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}

.code-comment-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.04));
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox-modal.open {
  display: flex;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-lg, 18px);
  box-shadow: 0 0 40px rgba(0,0,0,0.8);
  object-fit: contain;
}

@media (max-width: 1024px) {
  .project-page-layout, .code-studio-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Image Upload Zones ──────────────────────────────────── */
.img-upload-zone {
  position: relative;
  border: 2px dashed var(--border, rgba(255,255,255,0.12));
  border-radius: var(--radius-md, 12px);
  background: rgba(0,0,0,0.25);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  overflow: hidden;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-upload-zone:hover,
.img-upload-zone.drag-over {
  border-color: var(--primary, #00d68f);
  background: rgba(0, 214, 143, 0.05);
  box-shadow: 0 0 0 3px rgba(0, 214, 143, 0.12);
}

.img-upload-zone.multi {
  min-height: 120px;
  align-items: flex-start;
  padding: 12px;
}

.img-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 20px;
  color: var(--text-secondary, #8899b4);
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.img-upload-placeholder strong {
  color: var(--primary, #00d68f);
}

.img-upload-placeholder small {
  font-size: 0.8rem;
}

/* Cover preview */
.img-upload-preview {
  width: 100%;
  height: 200px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-md, 12px) - 2px);
  display: block;
}

/* Remove button (X) */
.img-remove-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  z-index: 2;
  backdrop-filter: blur(4px);
}
.img-remove-btn:hover {
  background: rgba(220, 53, 69, 0.85);
  transform: scale(1.1);
}

/* Screenshots grid */
.screenshots-preview-grid {
  display: none;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  padding: 4px 0;
}

.ss-preview-item {
  position: relative;
  width: 100px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  flex-shrink: 0;
}

.ss-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ss-preview-item .img-remove-btn {
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  font-size: 0.72rem;
}

.ss-add-more {
  width: 100px;
  height: 72px;
  border-radius: 8px;
  border: 2px dashed var(--border, rgba(255,255,255,0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.ss-add-more:hover {
  border-color: var(--primary, #00d68f);
  background: rgba(0,214,143,0.06);
}

