﻿/* =========================================================
   Soru Havuzu — Refined Dark UI
   Aesthetic: Warm editorial dark, minimal borders, breathing space
   Fonts: DM Serif Display + DM Sans
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* =========================================================
   1) Design Tokens
   ========================================================= */
:root {
  color-scheme: dark;

  /* Palette — warm dark */
  --color-bg:           #0c0c0f;
  --color-surface:      #131318;
  --color-surface-2:    #18181f;
  --color-surface-3:    #1e1e28;
  --color-border:       rgba(255,255,255,0.07);
  --color-border-strong:rgba(255,255,255,0.13);

  /* Text */
  --color-text:         #f0ede8;
  --color-text-2:       #a09a92;
  --color-text-muted:   #635e58;

  /* Accent — warm amber */
  --color-accent:       #e8a84a;
  --color-accent-dim:   rgba(232,168,74,0.12);
  --color-accent-press: #d4923a;

  /* Semantic */
  --color-success:      #3d9970;
  --color-success-bg:   rgba(61,153,112,0.1);
  --color-success-text: #7ecfaa;
  --color-danger:       #c0544a;
  --color-danger-bg:    rgba(192,84,74,0.1);
  --color-danger-text:  #e8968f;

  /* Spacing — 8px base */
  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 32px;
  --s6: 48px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Typography */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'Menlo', 'Consolas', monospace;

  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 15px;
  --text-lg:   18px;
  --text-xl:   22px;
  --text-2xl:  28px;
  --text-3xl:  36px;

  --leading: 1.6;

  /* Layout */
  --container-max: 860px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
}

/* =========================================================
   2) Reset
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  min-height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle grain texture over everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--s4) 0;
}

/* =========================================================
   3) Layout
   ========================================================= */
.container {
  width: min(var(--container-max), calc(100vw - var(--s4)));
  margin: var(--s5) auto;
  animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  padding: var(--s4);
  margin-bottom: var(--s3);
  transition: border-color 0.2s;
}

.page-head {
  margin-bottom: var(--s4);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--color-border);
}

.page-head h1 { margin-bottom: var(--s1); }
.page-head .small { margin: 0; }

.grid { display: grid; gap: var(--s3); }
.grid.two, .grid.three { grid-template-columns: 1fr; }

.row {
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.row > * { flex: 1; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.section-actions { margin-top: var(--s3); }

/* =========================================================
   4) Navigation
   ========================================================= */
.top-nav {
  display: flex;
  gap: var(--s1);
  margin-bottom: var(--s5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  padding: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}
.top-nav::-webkit-scrollbar { display: none; }

.top-nav a {
  flex: 1;
  min-width: max-content;
  display: block;
  text-decoration: none;
  text-align: center;
  padding: 9px var(--s3);
  border-radius: var(--r-lg);
  color: var(--color-text-2);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.top-nav a:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.top-nav a.active {
  background: var(--color-accent);
  color: #0c0c0f;
  font-weight: 600;
}

.quick-actions { margin-bottom: var(--s3); }
.quick-actions a {
  text-decoration: none;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--r-md);
  padding: var(--s2) var(--s3);
  color: var(--color-text-2);
  font-size: var(--text-sm);
  transition: border-color 0.15s, color 0.15s;
}
.quick-actions a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* =========================================================
   5) Typography
   ========================================================= */
h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 var(--s2);
  color: var(--color-text);
  letter-spacing: -0.01em;
}

h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: 1.3;
  margin: 0 0 var(--s3);
  color: var(--color-text);
}

h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0 0 var(--s2);
}

p { margin: 0 0 var(--s2); }

.small {
  font-size: var(--text-sm);
  color: var(--color-text-2);
  line-height: 1.5;
}

.answer-reveal {
  margin-top: var(--s2);
  padding: var(--s2) var(--s3);
  background: var(--color-surface-3);
  border-radius: var(--r-md);
  border-left: 2px solid var(--color-accent);
  font-size: var(--text-sm);
  color: var(--color-text);
}

/* =========================================================
   6) Forms
   ========================================================= */
label {
  display: block;
  margin-bottom: 6px;
  color: var(--color-text-2);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
}

input,
select,
textarea,
button {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
}

input,
select,
textarea {
  padding: 11px var(--s3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--r-md);
  background: var(--color-surface-2);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23635e58' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea {
  resize: vertical;
  min-height: 120px;
  line-height: var(--leading);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-accent);
  background: var(--color-surface-3);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: var(--s2);
  accent-color: var(--color-accent);
  vertical-align: middle;
  flex: none;
}

input[type="file"] {
  padding: var(--s2) var(--s3);
  font-size: var(--text-sm);
  color: var(--color-text-2);
  cursor: pointer;
}

/* =========================================================
   7) Buttons
   ========================================================= */
button {
  cursor: pointer;
  border: none;
  border-radius: var(--r-md);
  padding: 11px var(--s4);
  background: var(--color-accent);
  color: #0c0c0f;
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  line-height: 1;
}

button:hover  { background: var(--color-accent-press); }
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

button.secondary {
  background: var(--color-surface-3);
  color: var(--color-text-2);
  border: 1px solid var(--color-border-strong);
}
button.secondary:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

button.warn,
button.danger {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  border: 1px solid rgba(192,84,74,0.25);
}
button.warn:hover,
button.danger:hover {
  background: rgba(192,84,74,0.2);
  border-color: var(--color-danger);
}

.actions button,
.actions a {
  width: auto;
  min-width: 120px;
}

/* =========================================================
   8) Status messages
   ========================================================= */
.status {
  margin-top: var(--s3);
  padding: 11px var(--s3);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  line-height: 1.5;
  border: 1px solid transparent;
}

.status.info {
  background: var(--color-surface-2);
  color: var(--color-text-2);
  border-color: var(--color-border);
}

.status.success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border-color: rgba(61,153,112,0.25);
}

.status.error {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  border-color: rgba(192,84,74,0.25);
}

/* =========================================================
   9) KPI Cards
   ========================================================= */
.kpi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s2);
}

.kpi-item {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--s3) var(--s3);
  transition: border-color 0.2s;
}

.kpi-item:hover {
  border-color: var(--color-border-strong);
}

.kpi-item span {
  display: block;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--s1);
}

.kpi-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  color: var(--color-text);
}

/* =========================================================
   10) Question Cards & List
   ========================================================= */
.list {
  display: grid;
  gap: var(--s2);
}

.question-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--s3) var(--s4);
  transition: border-color 0.2s, background 0.2s;
  animation: fadeUp 0.25s ease both;
}

.question-card:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-2);
}

.question-card > div:first-child {
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  margin-bottom: var(--s2);
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin: var(--s2) 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  background: var(--color-surface-3);
  color: var(--color-text-2);
  border: 1px solid var(--color-border);
  line-height: 1.4;
}

.options {
  margin: var(--s2) 0;
  padding-left: var(--s4);
  color: var(--color-text-2);
  font-size: var(--text-sm);
}

.options li {
  margin-bottom: 6px;
  line-height: 1.5;
}

/* =========================================================
   11) Images
   ========================================================= */
.thumb {
  margin-top: var(--s2);
  max-width: 280px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  cursor: zoom-in;
  transition: border-color 0.2s, transform 0.2s;
}

.thumb:hover {
  border-color: var(--color-border-strong);
  transform: scale(1.01);
}

.inline-image-viewer {
  margin-top: var(--s2);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  background: var(--color-surface-2);
  padding: var(--s3);
  animation: fadeUp 0.2s ease both;
}

.inline-image-close {
  width: auto;
  min-width: 80px;
  margin-bottom: var(--s2);
}

.inline-image-full {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--r-md);
}

/* =========================================================
   12) Card action bar
   ========================================================= */
.section-actions.actions {
  padding-top: var(--s2);
  border-top: 1px solid var(--color-border);
  margin-top: var(--s3);
}

.section-actions.actions button {
  min-width: 0;
  padding: 8px 14px;
  font-size: var(--text-xs);
  letter-spacing: 0.03em;
}

#count {
  margin-bottom: var(--s2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}

/* =========================================================
   13) Table (future-proof)
   ========================================================= */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 10px var(--s3);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
}

th {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tr:last-child td { border-bottom: 0; }

/* =========================================================
   14) Utility
   ========================================================= */
.hidden { display: none !important; }

/* =========================================================
   15) Responsive
   ========================================================= */
@media (min-width: 540px) {
  .kpi {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 640px) {
  .container {
    margin-top: var(--s6);
    width: min(var(--container-max), calc(100vw - var(--s6)));
  }

  h1 { font-size: var(--text-3xl); }

  .grid.two {
    grid-template-columns: repeat(2, 1fr);
  }

  .panel {
    padding: var(--s5);
  }
}

@media (min-width: 900px) {
  .grid.three {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 539px) {
  .actions button,
  .actions a {
    width: 100%;
    min-width: 0;
  }

  .panel {
    padding: var(--s3);
  }

  h1 { font-size: var(--text-xl); }

  .top-nav a {
    padding: 8px var(--s2);
    font-size: var(--text-xs);
  }
}