/* ================================================================
   style.css  –  pw-hack-demo-app
   ================================================================ */

/* ----------------------------------------------------------------
   1. Reset & Base
   ---------------------------------------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #0a0a1a;
  color: #e0e0e0;
  min-height: 100vh;
}

/* ----------------------------------------------------------------
   2. Header & Container
   ---------------------------------------------------------------- */
.app-header {
  background: #111130;
  border-bottom: 2px solid #3a3aff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.app-header .logo { height: 48px; width: auto; }
.app-header h1   { font-size: 1.4rem; color: #7af; letter-spacing: 1px; }

.container { max-width: 900px; margin: 32px auto; padding: 0 16px; }

/* ----------------------------------------------------------------
   3. Cards
   ---------------------------------------------------------------- */
.card {
  background: #13132a;
  border: 1px solid #2a2a6a;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}
.card h2 {
  color: #7af;
  margin-bottom: 16px;
  font-size: 1.1rem;
  border-bottom: 1px solid #2a2a6a;
  padding-bottom: 8px;
}

/* ----------------------------------------------------------------
   4. Form Elements
   ---------------------------------------------------------------- */
select,
input[type=text],
input[type=password],
input[type=number] {
  background: #0d0d22;
  color: #e0e0e0;
  border: 1px solid #3a3aff;
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 1rem;
  width: 100%;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s;
}
select:focus, input:focus { border-color: #7af; }

/* ----------------------------------------------------------------
   5. Buttons
   ---------------------------------------------------------------- */
.btn {
  background: #3a3aff;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 12px 24px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  margin-right: 8px;
  margin-bottom: 8px;
}
.btn:hover    { background: #5555ff; }
.btn:disabled { background: #333; cursor: not-allowed; }

.btn-danger       { background: #aa1111; }
.btn-danger:hover { background: #cc3333; }

.btn-success       { background: #116611; }
.btn-success:hover { background: #228822; }

.btn-sm {
  padding: 4px 10px;
  font-size: 0.85rem;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  color: #fff;
  margin: 0 2px;
}
.btn-crack       { background: #664400; }
.btn-crack:hover { background: #995500; }

/* ----------------------------------------------------------------
   6. Shared Tables
   ---------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

th {
  background: #1a1a3a;
  color: #7af;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #3a3aff;
}
td {
  padding: 7px 10px;
  border-bottom: 1px solid #1e1e40;
  vertical-align: middle;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
tr:hover td { background: #16163a; }

.info-table th {
  width: 120px;
  background: transparent;
  color: #aaa;
  font-weight: normal;
  border-bottom: 1px solid #1e1e40;
}
.info-table td { color: #fff; }

/* ----------------------------------------------------------------
   7. Space info / PW section / Status
   ---------------------------------------------------------------- */
#space-info  { display: none; margin-bottom: 16px; }
#pw-section  { display: none; }

#status-msg {
  margin-top: 12px;
  min-height: 24px;
  font-size: 0.95rem;
}

/* ----------------------------------------------------------------
   8. Meta Disclosure
   ---------------------------------------------------------------- */
.meta-disclosure {
  margin-top: 16px;
  border-top: 1px solid #2a2a6a;
  padding-top: 12px;
}
.meta-disclosure summary,
#meta-toggle {
  color: #888;
  cursor: pointer;
  font-size: 0.85rem;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
}
#meta-panel {
  display: none;
  background: #0a0a16;
  border: 1px solid #2a2a6a;
  border-radius: 4px;
  padding: 12px;
  font-family: monospace;
  font-size: 0.78rem;
  color: #aaa;
  white-space: pre-wrap;
  margin-top: 8px;
  max-height: 300px;
  overflow-y: auto;
}

/* ----------------------------------------------------------------
   9. Stats Bar / Crack Progress
   ---------------------------------------------------------------- */
.stats-bar {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.stats-bar .stat {
  background: #1a1a3a;
  border-radius: 4px;
  padding: 6px 16px;
  font-size: 0.9rem;
}
.stats-bar .stat span { color: #7af; font-weight: bold; }

#crack-progress {
  font-family: monospace;
  font-size: 0.85rem;
  color: #fa0;
  margin-bottom: 12px;
  min-height: 20px;
}

/* ----------------------------------------------------------------
   10. Blocked Page
   ---------------------------------------------------------------- */
.blocked-container { max-width: 500px; margin: 80px auto; text-align: center; }
.blocked-container h1 { color: #f44; font-size: 2rem; margin-bottom: 16px; }
.blocked-container p  { color: #aaa; margin-bottom: 8px; }

/* ----------------------------------------------------------------
   11. Allowlist Editor
   ---------------------------------------------------------------- */
#allowlist-editor {
  width: 100%;
  min-height: 120px;
  background: #0d0d22;
  color: #e0e0e0;
  border: 1px solid #3a3aff;
  border-radius: 4px;
  padding: 10px;
  font-family: monospace;
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 8px;
}

/* ----------------------------------------------------------------
   12. Language Selector
   ---------------------------------------------------------------- */
.language-selector {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
}
.language-selector select {
  padding: 8px 12px;
  background: #1a1a1a;
  border: 1px solid #4a4;
  border-radius: 6px;
  color: #eee;
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.2s;
  /* override shared select reset */
  width: auto;
  margin-bottom: 0;
}
.language-selector select:hover  { background: #2a2a2a; border-color: #6c6; }
.language-selector select:focus  { border-color: #8f8; box-shadow: 0 0 0 2px rgba(136,255,136,0.2); }

/* ----------------------------------------------------------------
   13. Password Input Row & Calendar
   ---------------------------------------------------------------- */
.input-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 12px;
}
.input-row #pw-input { flex: 1; margin-bottom: 0; }

.calendar-btn {
  padding: 0 16px;
  background: #2a4a2a;
  border: 1px solid #4a4;
  border-radius: 6px;
  color: #eee;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  transition: background 0.2s;
}
.calendar-btn:hover { background: #3a5a3a; }

.date-picker-section {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #2a4a2a;
  border-radius: 8px;
  background: #0d1a0d;
}

#hidden-picker {
  position: absolute;
  visibility: hidden;
  width: 0;
  height: 0;
}
.flatpickr-calendar               { background: #1a1a1a !important; }
.flatpickr-day.flatpickr-disabled { color: #444 !important; }

/* ----------------------------------------------------------------
   14. Hash Preview
   ---------------------------------------------------------------- */
.hash-preview {
  margin-top: 14px;
  padding: 16px;
  background: #0a0a1a;
  border: 1px solid #334;
  border-radius: 8px;
  display: none;
}
.hash-preview.visible { display: block; }

.hash-generated-label {
  color: #8f8;
  font-size: 0.95em;
  font-weight: 600;
}
.hash-value {
  font-family: 'Courier New', monospace;
  font-size: 1.15em;
  font-weight: bold;
  word-break: break-all;
  color: #7af;
  margin-top: 8px;
  letter-spacing: 0.5px;
  line-height: 1.4;
}
.fingerprint-text {
  color: #aaa;
  font-size: 1.05em;
  line-height: 1.6;
  margin-top: 12px;
  font-weight: 500;
}

/* ----------------------------------------------------------------
   15. Explainer Sections
   ---------------------------------------------------------------- */
.project-explanation {
  margin-top: 30px;
  padding: 20px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #111;
  border-top: 4px solid #444;
}
.project-explanation h2 { margin-top: 0; color: #eee; }

.text-body  { color: #bbb; line-height: 1.6; }
.text-muted { color: #aaa; }
.step-description { color: #aaa; margin-bottom: 12px; }
.mt-12 { margin-top: 12px; }
.mt-15 { margin-top: 15px; }

.hash-explainer {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid #3a3a1a;
  border-radius: 8px;
  background: #1a1a0a;
  color: #bba;
  line-height: 1.75;
}
.hash-explainer h3 {
  color: #dd8;
  margin-top: 0;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cow-story {
  margin-top: 12px;
  padding: 14px;
  background: #111108;
  border-left: 4px solid #aa6;
  border-radius: 4px;
  font-style: italic;
  color: #cc9;
}

.warning-box {
  margin-top: 15px;
  padding: 15px;
  background: #2a0a0a;
  border: 1px solid #5a1a1a;
  border-radius: 6px;
  color: #faa;
}

/* ----------------------------------------------------------------
   16. Password Space Analysis
   ---------------------------------------------------------------- */
.password-space-analysis {
  margin-top: 30px;
  padding: 24px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #0f0f0f;
  border-top: 4px solid #555;
}
.password-space-analysis h2 { margin-top: 0; color: #eee; }

.method-list { color: #bbb; line-height: 1.8; margin-bottom: 20px; }

.table-container { overflow-x: auto; margin: 20px 0; }

.password-space-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
  background: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
}
.password-space-table thead    { background: #2a2a2a; }
.password-space-table th {
  padding: 12px 10px;
  text-align: left;
  color: #eee;
  font-weight: 600;
  border-bottom: 2px solid #444;
  background: #2a2a2a;
}
.password-space-table td {
  padding: 10px;
  border-bottom: 1px solid #2a2a2a;
  color: #ccc;
  max-width: none;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
}
.password-space-table tbody tr:hover { background: #252525; }

.digit-count { font-size: 0.85em; color: #888; font-style: italic; }

/* Row danger levels */
.danger-extreme       { background: #2a0a0a !important; }
.danger-extreme:hover { background: #3a1a1a !important; }
.danger-high          { background: #2a1500 !important; }
.danger-high:hover    { background: #3a2510 !important; }
.danger-medium        { background: #2a2000 !important; }
.danger-medium:hover  { background: #3a3010 !important; }
.danger-low           { background: #1a1a00 !important; }
.danger-low:hover     { background: #2a2a10 !important; }
.warning              { background: #1a1a0a !important; }
.warning:hover        { background: #2a2a1a !important; }
.safe                 { background: #0a1a0a !important; }
.safe:hover           { background: #1a2a1a !important; }

/* Key takeaways box */
.takeaways-box {
  margin-top: 24px;
  padding: 18px;
  background: #1a1a0a;
  border: 1px solid #3a3a1a;
  border-radius: 8px;
}
.takeaways-box h3  { color: #dd8; margin-top: 0; }
.takeaways-list    { color: #bba; line-height: 1.8; margin: 8px 0; padding-left: 20px; }

/* ----------------------------------------------------------------
   17. GPU Link & Tooltip  (pure-CSS, used in bullet list)
   ---------------------------------------------------------------- */
.gpu-link {
  color: #76b900;
  text-decoration: none;
  font-weight: 600;
  position: relative;
  border-bottom: 1px dotted #76b900;
}
.gpu-link:hover { color: #a0e000; }
.gpu-link:hover .gpu-tooltip { display: block; }

.gpu-tooltip {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 100%;
  margin-bottom: 8px;
  padding: 8px;
  background: #000;
  border: 2px solid #76b900;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  z-index: 1000;
  pointer-events: none;
}
.gpu-image {
  display: block;
  width: 320px;
  height: auto;
  border-radius: 4px;
}

/* ----------------------------------------------------------------
   18. RTX 4090 hover-thumbnail  (JS-injected, used on table <th>)
   ---------------------------------------------------------------- */
.gpu-tooltip-trigger {
  position: relative;
  cursor: help;
  border-bottom: 1px dashed #7af;
  white-space: nowrap;
}
.gpu-tooltip-img {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  background: #13132a;
  border: 2px solid #3a3aff;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.8);
  pointer-events: none;
}
.gpu-tooltip-img img {
  display: block;
  width: 200px;
  height: auto;
  border-radius: 6px;
  object-fit: cover;
}
.gpu-tooltip-img .gpu-tooltip-caption {
  display: block;
  text-align: center;
  font-size: 0.72rem;
  color: #7af;
  margin-top: 5px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.gpu-tooltip-trigger:hover .gpu-tooltip-img,
.gpu-tooltip-trigger:focus .gpu-tooltip-img { display: block; }
th:has(.gpu-tooltip-trigger),
td:has(.gpu-tooltip-trigger) { overflow: visible !important; }

/* ----------------------------------------------------------------
   19. Footer
   ---------------------------------------------------------------- */
.app-footer {
  text-align: center;
  padding: 12px 0 8px;
  margin-top: 32px;
  border-top: 1px solid #222;
}
#version-footer {
  font-size: 0.7em;
  color: #555;
  font-family: monospace;
}

/* ----------------------------------------------------------------
   20. Responsive
   ---------------------------------------------------------------- */
@media (max-width: 600px) {
  .app-header h1 { font-size: 1rem; }
  .container     { padding: 0 8px; }
  td, th         { padding: 5px 6px; font-size: 0.8rem; }
  .gpu-image     { width: 200px; }
}
