/* ==========================================================================
   SınavLab - Hızlı Optik Cevaplama Modülü Stilleri (optical.css)
   ========================================================================== */

.optical-module-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ==========================================
   1. KURULUM & SEÇİM EKRANI (SETUP VIEW)
   ========================================== */
.optical-setup-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.optical-setup-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary), var(--secondary));
}

.optical-setup-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.5rem;
}

.optical-icon-badge {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 20px var(--accent-glow);
}

.optical-setup-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.optical-setup-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Kurulum Sekmeleri (Kayıtlı Sınav vs Özel Test) */
.optical-mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.optical-mode-card {
  border: 2px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.optical-mode-card:hover {
  border-color: var(--border-focus);
  background: var(--bg-surface-hover);
  transform: translateY(-2px);
}

.optical-mode-card.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 20px var(--primary-glow);
}

.optical-mode-card input[type="radio"] {
  margin-top: 0.25rem;
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.optical-mode-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.optical-mode-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

/* Kurulum Form Alanı */
.optical-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.optical-quick-counts {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.optical-count-pill {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.optical-count-pill:hover,
.optical-count-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Cevap Anahtarı Giriş Kutusu */
.optical-key-box {
  background: var(--bg-surface-elevated);
  border: 1px dashed var(--border-focus);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
}

.optical-key-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ==========================================
   2. AKTİF OPTİK CEVAPLAMA ÇALIŞMA ALANI
   ========================================== */
.optical-active-workspace {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Üst Kontrol & Durum Barı */
.optical-status-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
  position: sticky;
  top: 72px;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.optical-status-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.optical-badge-tag {
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
  color: #ffffff;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.optical-progress-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.optical-progress-fill {
  width: 90px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.optical-progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: width 0.3s ease;
}

.optical-timer-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--accent);
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.optical-actions-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ==========================================
   OPTİK FORM KAĞIDI (BUBBLE SHEET)
   ========================================== */
.optical-sheet-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.optical-sheet-header-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed var(--border-subtle);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.optical-sheet-instructions {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.optical-kbd-hint {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
  font-weight: 700;
}

/* Çok Sütunlu Optik Izgara */
.optical-columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.optical-column-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.optical-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.optical-col-header .col-options-header {
  display: flex;
  gap: 0.85rem;
  padding-right: 0.4rem;
}

/* Optik Satır */
.opt-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  user-select: none;
}

.opt-row-item:hover {
  background: var(--bg-surface-hover);
}

.opt-row-item.current-active {
  background: rgba(99, 102, 241, 0.18);
  border-left: 3px solid var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.opt-row-item.is-flagged {
  background: rgba(245, 158, 11, 0.12);
}

.opt-row-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.opt-row-num {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 800;
  width: 28px;
  color: var(--text-primary);
}

.opt-row-flag-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: var(--transition);
}

.opt-row-flag-btn:hover,
.opt-row-flag-btn.active {
  color: var(--warning);
}

.opt-row-bubbles {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Optik Baloncuk (Bubble) */
.opt-bubble-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border-focus);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.opt-bubble-btn:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  transform: scale(1.12);
  background: rgba(99, 102, 241, 0.15);
}

.opt-bubble-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 14px var(--primary-glow);
  transform: scale(1.08);
}

.opt-row-clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.opt-row-item:hover .opt-row-clear-btn,
.opt-row-item.current-active .opt-row-clear-btn {
  opacity: 0.8;
}

.opt-row-clear-btn:hover {
  opacity: 1;
  color: var(--danger);
}

/* ==========================================
   3. ANLIK DEĞERLENDİRME & KARNE EKRANI
   ========================================== */
.optical-results-container {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  animation: fadeIn 0.4s ease-out;
}

/* Sonuç Başlık Kartı */
.optical-results-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.optical-results-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--success), var(--accent), var(--primary));
}

.optical-results-title h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.optical-results-title p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

/* İstatistik Metrikleri Kartları */
.optical-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}

.optical-metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.optical-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.optical-metric-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.optical-metric-icon.correct {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.optical-metric-icon.wrong {
  background: rgba(244, 63, 94, 0.15);
  color: var(--danger);
}

.optical-metric-icon.empty {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
}

.optical-metric-icon.net {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
}

.optical-metric-icon.score {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.optical-metric-data {
  display: flex;
  flex-direction: column;
}

.optical-metric-val {
  font-size: 1.6rem;
  font-weight: 900;
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.1;
}

.optical-metric-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 0.2rem;
}

/* Karşılaştırmalı Detaylı Tablo Kartı */
.optical-breakdown-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

.optical-breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.optical-filter-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.optical-filter-btn {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.optical-filter-btn:hover {
  border-color: var(--border-focus);
  color: var(--text-primary);
}

.optical-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 12px var(--primary-glow);
}

/* Soru Karşılaştırma Tablosu */
.optical-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.optical-eval-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.optical-eval-table th {
  background: var(--bg-surface-elevated);
  padding: 0.85rem 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.optical-eval-table td {
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.optical-eval-table tr:hover {
  background: var(--bg-surface-hover);
}

.optical-eval-table tr.is-correct {
  background: rgba(16, 185, 129, 0.04);
}

.optical-eval-table tr.is-wrong {
  background: rgba(244, 63, 94, 0.04);
}

.optical-eval-table tr.is-empty {
  background: transparent;
}

/* Cevap Rozetleri */
.opt-ans-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.82rem;
}

.opt-ans-bubble.user-correct {
  background: var(--success);
  color: #ffffff;
  box-shadow: 0 0 8px var(--success-glow);
}

.opt-ans-bubble.user-wrong {
  background: var(--danger);
  color: #ffffff;
  box-shadow: 0 0 8px var(--danger-glow);
}

.opt-ans-bubble.user-empty {
  background: var(--bg-surface-elevated);
  border: 1px dashed var(--text-muted);
  color: var(--text-muted);
}

.opt-ans-bubble.key-bubble {
  background: var(--primary);
  color: #ffffff;
}

.opt-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

.opt-status-tag.correct {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.opt-status-tag.wrong {
  background: rgba(244, 63, 94, 0.15);
  color: var(--danger);
}

.opt-status-tag.empty {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
}

/* Yazdırma Raporu (Print) */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .app-header,
  .optical-status-bar,
  .optical-filter-group,
  .optical-results-actions,
  .btn {
    display: none !important;
  }

  .optical-setup-card,
  .optical-results-hero,
  .optical-breakdown-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    background: #ffffff !important;
    color: #000000 !important;
  }

  .optical-eval-table th,
  .optical-eval-table td {
    border-color: #ddd !important;
    color: #000000 !important;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .optical-mode-selector {
    grid-template-columns: 1fr;
  }

  .optical-setup-card,
  .optical-sheet-card,
  .optical-results-hero {
    padding: 1.25rem;
  }

  .optical-columns-grid {
    grid-template-columns: 1fr;
  }

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