/* ==========================================================================
   SQLSphere - Modern SQL Sunucu Tanılama & Sağlık Kontrolü Tasarım Sistemi
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #080C14;
  --bg-secondary: #0F172A;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-input: rgba(15, 23, 42, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #6366F1;
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  
  --success: #10B981;
  --success-glow: rgba(16, 185, 129, 0.35);
  --warning: #F59E0B;
  --warning-glow: rgba(245, 158, 11, 0.35);
  --danger: #EF4444;
  --danger-glow: rgba(239, 68, 68, 0.35);
  --cyan: #06B6D4;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(6, 182, 212, 0.10) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
}

/* Arka plan ızgara deseni */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  pointer-events: none;
  z-index: 0;
}

.app-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Header & Navbar
   ========================================================================== */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-color);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366F1 0%, #06B6D4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.brand-icon svg {
  width: 28px;
  height: 28px;
  color: #fff;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.brand-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #FFFFFF 30%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.system-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  font-size: 0.775rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
}

.system-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* ==========================================================================
   Ana Düzen (Grid Layout)
   ========================================================================== */

.main-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

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

/* ==========================================================================
   Cam Kartlar (Glassmorphic Cards)
   ========================================================================== */

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.glass-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.4), transparent);
}

.card-title-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.card-title svg {
  color: var(--primary);
}

/* ==========================================================================
   Hızlı Önayarlar (Quick Presets)
   ========================================================================== */

.preset-strip {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.preset-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.preset-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* ==========================================================================
   Form Elemanları
   ========================================================================== */

.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-label .hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 400;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  pointer-events: none;
  transition: var(--transition);
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.925rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-control.font-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
}

.form-control:focus {
  border-color: var(--border-focus);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--primary);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394A3B8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
  cursor: pointer;
}

/* Mod Seçim Kartları (Radio Tiles) */
.mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.mode-tile {
  position: relative;
  cursor: pointer;
}

.mode-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-tile-card {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: var(--transition);
  height: 100%;
}

.mode-tile-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mode-tile-desc {
  font-size: 0.725rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.mode-tile input:checked + .mode-tile-card {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 0 1px var(--primary);
}

/* Butonlar */
.btn-submit {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  box-shadow: 0 10px 25px var(--primary-glow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(99, 102, 241, 0.5);
  background: linear-gradient(135deg, #4F46E5 0%, #4338CA 100%);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Canlı İzleme Toggle */
.auto-monitor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  margin-top: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  font-size: 0.825rem;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
  border-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #fff;
}

/* ==========================================================================
   Sağ Panel: Canlı Tanılama & Durum Göstergesi
   ========================================================================== */

.status-hero {
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.status-hero.online {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(15, 23, 42, 0.6) 100%);
  border-color: rgba(16, 185, 129, 0.3);
}

.status-hero.offline {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(15, 23, 42, 0.6) 100%);
  border-color: rgba(239, 68, 68, 0.3);
}

.status-hero.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(15, 23, 42, 0.6) 100%);
  border-color: rgba(245, 158, 11, 0.3);
}

.status-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-beacon {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.beacon-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--text-dim);
  position: relative;
}

.beacon-dot.online {
  background-color: var(--success);
  box-shadow: 0 0 16px var(--success);
  animation: pulse-green 2s infinite;
}

.beacon-dot.offline {
  background-color: var(--danger);
  box-shadow: 0 0 16px var(--danger);
}

.beacon-dot.warning {
  background-color: var(--warning);
  box-shadow: 0 0 16px var(--warning);
  animation: pulse-yellow 2s infinite;
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-yellow {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.status-title-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.status-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

.status-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Metrik Izgarası (Latency, Engine, IP, SSL) */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.metric-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Detaylı Bilgi Listesi */
.diagnostics-list {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.diag-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
}

.diag-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.diag-item:first-child {
  padding-top: 0;
}

.diag-name {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.diag-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.825rem;
  color: #fff;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Çözüm Önerisi Kutusu */
.suggestion-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.825rem;
  color: #FDE68A;
  margin-bottom: 1.5rem;
  line-height: 1.5;
  display: flex;
  gap: 0.75rem;
}

.suggestion-box svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--warning);
}

/* Veritabanı Etiketleri */
.db-tags-group {
  margin-top: 1rem;
}

.db-tags-title {
  font-size: 0.775rem;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.db-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 120px;
  overflow-y: auto;
}

.db-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
}

/* ==========================================================================
   Alt Bölüm: Test Geçmişi Tablosu
   ========================================================================== */

.history-card {
  margin-top: 2rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.history-table th {
  padding: 0.85rem 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-color);
  font-weight: 700;
}

.history-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.history-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: #fff;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.725rem;
  font-weight: 700;
}

.badge-online {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-offline {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Radar Tarama & Yükleniyor Göstergesi */
.radar-overlay {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  z-index: 10;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.radar-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.radar-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
}

/* Buton grubu */
.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ==========================================================================
   Responsive Ayarları
   ========================================================================== */

@media (max-width: 640px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .form-row, .mode-selector, .metrics-grid {
    grid-template-columns: 1fr;
  }

  .glass-card {
    padding: 1.25rem;
  }
}
