/* ══════════════════════════════════════════════
   YKS 2026 Tahmini Sıralama Hesaplayıcı — CSS
   ══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  
  --accent-primary: #2563eb; /* Royal Blue */
  --accent-secondary: #1d4ed8;
  --accent-light: #eff6ff;
  --accent-glow: rgba(37, 99, 235, 0.08);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-accent: #2563eb;
  
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --success-glow: rgba(22, 163, 74, 0.1);
  
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  
  --error: #dc2626;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --error-glow: rgba(220, 38, 38, 0.1);
  
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(
      ellipse 600px 600px at 10% 10%,
      rgba(37, 99, 235, 0.04) 0%,
      transparent 80%
    ),
    radial-gradient(
      ellipse 500px 500px at 90% 90%,
      rgba(59, 130, 246, 0.03) 0%,
      transparent 80%
    );
  background-color: #f8fafc;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.hero {
  text-align: center;
  padding: var(--space-3xl) 0 var(--space-2xl);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: var(--accent-light);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: var(--space-lg);
  letter-spacing: 0.02em;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, #2563eb 30%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  font-weight: 400;
}

.section {
  margin-bottom: var(--space-2xl);
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: var(--space-sm);
}

.section-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--accent-primary);
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.section-total {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 4px 12px;
  background: var(--accent-light);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: var(--radius-full);
}

.section-total-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.section-total-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-primary);
  font-variant-numeric: tabular-nums;
}

/* ── OBP Section ─────────────────────────────── */
/* OBP Section */
.obp-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  transition: all var(--transition-base);
}

.obp-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

.obp-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xl);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.obp-input-group {
  width: 100%;
  max-width: 280px;
}

.obp-input-field {
  text-align: left !important;
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  padding: 12px 16px !important;
  color: var(--accent-primary) !important;
  background-color: var(--bg-primary) !important;
  border: 1px solid var(--border-color) !important;
}

.obp-input-field:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
  background-color: #ffffff !important;
}

.obp-checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  user-select: none;
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 5px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  position: relative;
}

.checkbox-custom::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--accent-primary);
  opacity: 0;
  transform: scale(0);
  transition: all var(--transition-fast);
}

.checkbox-input:checked + .checkbox-custom {
  border-color: var(--accent-primary);
  background: var(--accent-light);
}

.checkbox-input:checked + .checkbox-custom::after {
  opacity: 1;
  transform: scale(1);
}

.checkbox-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.checkbox-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Ders Grid */
.ders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-md);
}

/* Ders Card */
.ders-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: all var(--transition-base);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  position: relative;
}

.ders-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

.ders-card:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.ders-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.ders-soru-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.ders-inputs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.input-group {
  flex: 1;
}

.input-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-field {
  width: 100%;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  transition: all var(--transition-fast);
  text-align: center;
}

.input-field:focus {
  border-color: var(--accent-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-field.input-dogru:focus {
  border-color: var(--success);
  box-shadow: 0 0 0 3px var(--success-glow);
}

.input-field.input-yanlis:focus {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-glow);
}

/* Hide number input arrows */
.input-field::-webkit-outer-spin-button,
.input-field::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.input-field[type='number'] {
  -moz-appearance: textfield;
}

/* Net Indicator */
.net-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.net-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.net-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.net-value.positive {
  color: var(--success);
}

.net-value.negative {
  color: var(--error);
}

.net-value.zero {
  color: var(--text-muted);
}

/* ── Hesapla Button ──────────────────────────── */
/* Hesapla Button */
.hesapla-wrapper {
  display: flex;
  justify-content: center;
  margin: var(--space-2xl) 0;
}

.btn-hesapla {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 16px 48px;
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-hesapla:hover {
  background: var(--accent-secondary);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

.btn-hesapla:active {
  transform: translateY(1px);
}

.btn-hesapla.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-hesapla .spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-hesapla.loading .spinner {
  display: block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Results Section */
.results-section {
  display: none;
  animation: fadeInUp 0.5s ease-out;
}

.results-section.visible {
  display: block;
}

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

/* Tahmin 2026 Big Card */
.tahmin-card {
  background: var(--accent-light);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  margin-bottom: var(--space-2xl);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.05);
}

.tahmin-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}

.tahmin-value {
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 900;
  color: var(--accent-primary);
  line-height: 1.1;
  margin-bottom: var(--space-xs);
}

.tahmin-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.tahmin-band {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 999px;
  padding: var(--space-xs) var(--space-md);
  margin-bottom: var(--space-sm);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.tahmin-band.visible {
  opacity: 1;
  transform: translateY(0);
}

.tahmin-band .band-arrow {
  font-size: 0.75rem;
  opacity: 0.6;
}

.tahmin-band .band-sep {
  opacity: 0.4;
  font-weight: 400;
}

/* Year Cards Grid */
.yil-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-3xl);
}

.yil-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  opacity: 0;
  animation: staggerIn 0.4s ease-out forwards;
}

.yil-card:nth-child(1) { animation-delay: 0.05s; }
.yil-card:nth-child(2) { animation-delay: 0.1s; }
.yil-card:nth-child(3) { animation-delay: 0.15s; }
.yil-card:nth-child(4) { animation-delay: 0.2s; }

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

.yil-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.03);
}

.yil-year {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.yil-puan {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.yil-puan-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-md);
}

.yil-siralama {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-primary);
}

.yil-siralama-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--space-sm) 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 28px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-full);
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 1000;
  transition: transform var(--transition-slow);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.05);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.footer {
  text-align: center;
  padding: var(--space-xl) 0 var(--space-2xl);
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border-color);
  margin-top: var(--space-2xl);
}

/* Validation styles */
.input-field.has-error {
  border-color: var(--error) !important;
  background-color: var(--error-bg) !important;
}

.ders-card.card-error {
  border-color: var(--error) !important;
  box-shadow: 0 0 8px var(--error-glow) !important;
}

.validation-msg {
  font-size: 0.75rem;
  color: var(--error);
  margin-top: 6px;
  min-height: 1em;
  opacity: 0;
  transition: opacity var(--transition-fast);
  font-weight: 500;
}

.validation-msg.visible {
  opacity: 1;
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }

  .hero {
    padding: var(--space-2xl) 0 var(--space-xl);
  }

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

  .obp-row {
    flex-direction: column;
    align-items: stretch;
  }

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

  .btn-hesapla {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .ders-grid {
    grid-template-columns: 1fr;
  }

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