﻿/* ============================================================
   WINDOWS BSOD CHEAT SHEET — STYLES v2
   Dark/Light Mode + Live Dump Badge + All Features
   ============================================================ */

/* ---------- CSS Variables — Dark Mode (default) ---------- */
:root {
  --bg-main:        #0a0e1a;
  --bg-card:        #111827;
  --bg-card-hover:  #1a2235;
  --bg-controls:    #0d1321;
  --accent:         #3b82f6;
  --accent-hover:   #60a5fa;
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --border:         #1e293b;
  --border-light:   #2d3f55;
  --code-bg:        #0f172a;
  --shadow:         0 4px 24px rgba(0,0,0,0.4);
  --radius:         12px;
  --radius-sm:      8px;
  --transition:     0.2s ease;
  --sev-low:        #22c55e;
  --sev-medium:     #f59e0b;
  --sev-high:       #ef4444;
  --livedump-color: #a78bfa;
}

/* ---------- Light Mode ---------- */
body.light-mode {
  --bg-main:        #f1f5f9;
  --bg-card:        #ffffff;
  --bg-card-hover:  #f8fafc;
  --bg-controls:    #e2e8f0;
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --border:         #cbd5e1;
  --border-light:   #94a3b8;
  --code-bg:        #f1f5f9;
  --shadow:         0 4px 24px rgba(0,0,0,0.1);
}
body.light-mode .site-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 60%, #2563eb 100%);
}
body.light-mode .site-header p { color: #bfdbfe; }
body.light-mode .cmd-desc  { background: #f0fdf4; border-color: #86efac44; }
body.light-mode .cmd-focus { background: #eff6ff; border-color: #93c5fd44; }
body.light-mode .cmd-line  { color: #166534; background: #f0fdf4; }
body.light-mode .cmd-line:hover { background: #dcfce7; }
body.light-mode #searchInput { color: var(--text-primary); }
body.light-mode .modal { background: #ffffff; }
body.light-mode .modal-code { background: #f1f5f9; }

/* Light mode — Severity badges: ألوان واضحة على خلفية فاتحة */
body.light-mode .badge-sev-low    { background: #dcfce7; color: #15803d; border-color: #86efac; }
body.light-mode .badge-sev-medium { background: #fef9c3; color: #92400e; border-color: #fde047; }
body.light-mode .badge-sev-high   { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* Light mode — Category badges: ألوان قوية وواضحة */
body.light-mode .badge-cat-driver   { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
body.light-mode .badge-cat-memory   { background: #cffafe; color: #0e7490; border-color: #67e8f9; }
body.light-mode .badge-cat-hardware { background: #ffedd5; color: #c2410c; border-color: #fdba74; }
body.light-mode .badge-cat-storage  { background: #fef9c3; color: #a16207; border-color: #fde047; }
body.light-mode .badge-cat-system   { background: #fce7f3; color: #be185d; border-color: #f9a8d4; }
body.light-mode .badge-cat-gpu      { background: #ede9fe; color: #6d28d9; border-color: #c4b5fd; }
body.light-mode .badge-livedump     { background: #ede9fe; color: #5b21b6; border-color: #a78bfa; }

/* Light mode — Severity filter pills */
body.light-mode .pill[data-sev="low"].active    { background: #16a34a; border-color: #16a34a; color: #fff; }
body.light-mode .pill[data-sev="medium"].active { background: #d97706; border-color: #d97706; color: #fff; }
body.light-mode .pill[data-sev="high"].active   { background: #dc2626; border-color: #dc2626; color: #fff; }

/* Light mode — Tags */
body.light-mode .tag { background: #e2e8f0; border-color: #cbd5e1; color: #475569; }

/* Light mode — Card code */
body.light-mode .card-code { background: #e0f2fe; color: #1d4ed8; border-color: #93c5fd; }

/* Light mode — fix numbers */
body.light-mode .fix-num { background: #2563eb; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  direction: rtl;
  transition: background 0.3s ease, color 0.3s ease;
}
a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(135deg, #0d1b3e 0%, #0a0e1a 60%, #0d1321 100%);
  border-bottom: 1px solid var(--border-light);
  padding: 20px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.header-logo { display: flex; align-items: center; gap: 16px; }
.bsod-icon { font-size: 2.2rem; filter: drop-shadow(0 0 12px #3b82f688); }
.site-header h1 { font-size: 1.5rem; font-weight: 700; color: #fff; letter-spacing: 0.5px; }
.site-header p  { font-size: 0.83rem; color: var(--text-secondary); margin-top: 2px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-stats   { display: flex; gap: 12px; }
.stat-item {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.stat-item span { color: var(--accent-hover); font-weight: 700; }

/* Theme Toggle */
.theme-toggle {
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover { background: rgba(255,255,255,0.2); transform: rotate(20deg); }

/* ---------- Controls Bar ---------- */
.controls-bar {
  background: var(--bg-controls);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  position: sticky;
  top: 85px;
  z-index: 99;
}
.controls-inner { max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Search */
.search-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  padding: 10px 16px;
  gap: 10px;
  transition: border-color var(--transition);
}
.search-wrap:focus-within { border-color: var(--accent); }
.search-icon { font-size: 1rem; color: var(--text-muted); }
#searchInput {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 0.97rem; direction: rtl; font-family: inherit;
}
#searchInput::placeholder { color: var(--text-muted); }
.clear-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 0.85rem; padding: 2px 6px; border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}
.clear-btn:hover { color: var(--text-primary); background: var(--border); }

/* Filter Pills */
.filter-wrap, .severity-wrap, .type-wrap {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.filter-label {
  font-size: 0.75rem; color: var(--text-muted); margin-left: 4px; white-space: nowrap;
}
.pill {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  white-space: nowrap;
}
.pill:hover { border-color: var(--accent); color: var(--text-primary); }
.pill.active {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}
.pill[data-sev="low"].active    { background: var(--sev-low);    border-color: var(--sev-low); }
.pill[data-sev="medium"].active { background: var(--sev-medium); border-color: var(--sev-medium); color: #000; }
.pill[data-sev="high"].active   { background: var(--sev-high);   border-color: var(--sev-high); }
.pill[data-type="livedump"].active { background: var(--livedump-color); border-color: var(--livedump-color); }

/* ---------- Results Info ---------- */
.results-info {
  max-width: 1400px; margin: 12px auto 0; padding: 0 24px;
  font-size: 0.82rem; color: var(--text-muted); min-height: 20px;
}

/* ---------- Cards Grid ---------- */
.cards-grid {
  max-width: 1400px; margin: 16px auto 40px; padding: 0 24px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px;
}

/* ---------- Card ---------- */
.bsod-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.bsod-card:hover {
  transform: translateY(-3px); border-color: var(--accent);
  background: var(--bg-card-hover); box-shadow: var(--shadow);
}
.bsod-card.is-livedump { border-color: #3b2f6a55; }
.bsod-card.is-livedump:hover { border-color: var(--livedump-color); }

/* Card header */
.card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.card-code-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-code {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 1rem; font-weight: 700; color: var(--accent-hover);
  background: var(--code-bg); padding: 4px 10px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-light); letter-spacing: 0.5px;
}
/* Copy code button on card */
.card-copy-btn {
  background: none; border: 1px solid var(--border-light); border-radius: 6px;
  color: var(--text-muted); cursor: pointer; padding: 3px 8px; font-size: 0.7rem;
  transition: all var(--transition); white-space: nowrap;
}
.card-copy-btn:hover { color: var(--accent-hover); border-color: var(--accent); background: var(--code-bg); }
.card-copy-btn.copied { color: var(--sev-low); border-color: var(--sev-low); }

.card-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge {
  font-size: 0.68rem; font-weight: 600; padding: 3px 9px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.badge-sev-low    { background: #14532d55; color: var(--sev-low);    border: 1px solid #14532d; }
.badge-sev-medium { background: #78350f55; color: var(--sev-medium); border: 1px solid #78350f; }
.badge-sev-high   { background: #7f1d1d55; color: var(--sev-high);   border: 1px solid #7f1d1d; }
.badge-cat-driver   { background: #1e3a5f55; color: #93c5fd; border: 1px solid #1e3a5f; }
.badge-cat-memory   { background: #164e6355; color: #67e8f9; border: 1px solid #164e63; }
.badge-cat-hardware { background: #7c2d1255; color: #fdba74; border: 1px solid #7c2d12; }
.badge-cat-storage  { background: #71350155; color: #fde047; border: 1px solid #713501; }
.badge-cat-system   { background: #83185555; color: #f9a8d4; border: 1px solid #831858; }
.badge-cat-gpu      { background: #3b0f6455; color: #c4b5fd; border: 1px solid #3b0f64; }
.badge-livedump     { background: #2e1a5566; color: var(--livedump-color); border: 1px solid #4c1d95; font-size: 0.62rem; }

.card-name {
  font-size: 0.88rem; font-weight: 600; color: var(--text-primary);
  margin-bottom: 8px; word-break: break-all;
  font-family: 'Consolas', 'Courier New', monospace;
}
.card-cause {
  font-size: 0.83rem; color: var(--text-secondary); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer {
  margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.card-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag {
  font-size: 0.68rem; color: var(--text-muted); background: var(--code-bg);
  border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px;
}
.card-more { font-size: 0.75rem; color: var(--accent); white-space: nowrap; font-weight: 500; }

/* ---------- No Results ---------- */
.no-results { text-align: center; padding: 80px 24px; color: var(--text-muted); }
.no-results span { font-size: 3rem; display: block; margin-bottom: 12px; }
.no-results p { font-size: 1rem; margin-bottom: 6px; color: var(--text-secondary); }
.no-results small { font-size: 0.82rem; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--bg-card); border: 1.5px solid var(--border-light);
  border-radius: var(--radius); max-width: 700px; width: 100%;
  max-height: 88vh; overflow-y: auto; padding: 28px; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6); animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute; top: 16px; left: 16px;
  background: var(--border); border: none; color: var(--text-primary);
  cursor: pointer; border-radius: 6px; width: 30px; height: 30px;
  font-size: 0.85rem; transition: background var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--sev-high); }

/* Modal header actions */
.modal-header-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.modal-code {
  font-family: 'Consolas','Courier New',monospace;
  font-size: 1.35rem; font-weight: 700; color: var(--accent-hover);
  background: var(--code-bg); padding: 7px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-light); display: inline-block;
}
.modal-share-btn, .modal-evtview-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-sm); font-size: 0.75rem;
  font-weight: 600; cursor: pointer; border: 1px solid; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}
.modal-share-btn {
  background: var(--code-bg); color: var(--text-secondary); border-color: var(--border-light);
}
.modal-share-btn:hover { border-color: var(--accent); color: var(--accent-hover); }
.modal-share-btn.copied { color: var(--sev-low); border-color: var(--sev-low); }
.modal-evtview-btn {
  background: #1e3a5f33; color: #93c5fd; border-color: #1e3a5f;
}
.modal-evtview-btn:hover { background: #1e3a5f66; text-decoration: none; }

.modal-name {
  font-family: 'Consolas','Courier New',monospace;
  font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 14px; word-break: break-all;
}
.modal-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.modal-section { margin-bottom: 18px; }
.modal-section h3 {
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.modal-cause { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.7; }
.fix-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.fix-list li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6;
}
.fix-num {
  background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 700;
  border-radius: 50%; min-width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px; flex-shrink: 0;
}
/* Commands */
.commands-wrap { display: flex; flex-direction: column; gap: 12px; }
.cmd-block { display: flex; flex-direction: column; }
.cmd-line {
  font-family: 'Consolas','Courier New',monospace;
  font-size: 0.85rem; color: #86efac; background: var(--code-bg);
  padding: 9px 14px; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; cursor: pointer; transition: border-color var(--transition), background var(--transition);
}
.cmd-block:not(:has(.cmd-desc)) .cmd-line { border-radius: var(--radius-sm); }
.cmd-line:hover { border-color: #22c55e55; background: #0a1f0f; }
.cmd-text { flex: 1; word-break: break-all; }
.cmd-copy {
  font-size: 0.7rem; color: var(--text-muted); white-space: nowrap;
  font-family: 'Segoe UI',sans-serif; flex-shrink: 0; transition: color var(--transition);
}
.cmd-line:hover .cmd-copy { color: #86efac; }
.cmd-desc {
  background: #0d1f10; border: 1px solid #22c55e22; border-top: none;
  padding: 7px 14px; font-size: 0.78rem; color: var(--text-secondary); line-height: 1.6;
}
.cmd-focus {
  background: #0f1a2a; border: 1px solid #3b82f622; border-top: none;
  padding: 7px 14px; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: 0.78rem; color: var(--text-secondary); line-height: 1.6;
}
.cmd-desc-what { color: #86efac; font-weight: 600; }
.cmd-focus-label { color: #60a5fa; font-weight: 600; }
.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Back to Top ---------- */
.back-to-top {
  position: fixed; bottom: 24px; left: 24px;
  background: var(--accent); color: #fff; border: none;
  border-radius: 50%; width: 44px; height: 44px; font-size: 1.1rem;
  cursor: pointer; box-shadow: 0 4px 16px rgba(59,130,246,0.4);
  transition: background var(--transition), transform var(--transition);
  z-index: 150; display: flex; align-items: center; justify-content: center;
}
.back-to-top:hover { background: var(--accent-hover); transform: translateY(-2px); }
.back-to-top.hidden { display: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-controls);
  padding: 32px 24px;
}
.footer-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 28px;
}
.footer-tools h4 {
  font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 14px;
}
.tools-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px;
}
.tool-link {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 10px; text-align: center;
  text-decoration: none; transition: all var(--transition); color: var(--text-secondary);
}
.tool-link:hover {
  border-color: var(--accent); color: var(--text-primary);
  transform: translateY(-2px); text-decoration: none;
}
.tool-icon { font-size: 1.4rem; }
.tool-link span:not(.tool-icon) { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.tool-link small { font-size: 0.7rem; color: var(--text-muted); }
.footer-links {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.footer-credits { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 600; text-decoration: none;
  transition: all var(--transition); border: 1px solid;
}
.github-btn  { background: #24292e; color: #fff; border-color: #444d56; }
.github-btn:hover  { background: #2f363d; text-decoration: none; transform: translateY(-1px); }
.linkedin-btn { background: #0077b5; color: #fff; border-color: #0077b5; }
.linkedin-btn:hover { background: #006097; text-decoration: none; transform: translateY(-1px); }
.website-btn { background: #0f766e; color: #fff; border-color: #0f766e; }
.website-btn:hover { background: #0d9488; text-decoration: none; transform: translateY(-1px); }
.portfolio-btn { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.portfolio-btn:hover { background: #6d28d9; text-decoration: none; transform: translateY(-1px); }
.footer-meta { font-size: 0.78rem; color: var(--text-muted); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::selection { background: #3b82f640; color: #fff; }
.hidden { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .site-header h1 { font-size: 1.15rem; }
  .cards-grid { grid-template-columns: 1fr; padding: 0 12px; }
  .controls-bar { top: 78px; }
  .modal { padding: 18px; }
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
  .header-stats { display: none; }
}
@media (max-width: 480px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-links { flex-direction: column; align-items: flex-start; }
}
