/* ─── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── CSS Variables ────────────────────────────────────────── */
:root {
  --primary:        #6366f1;
  --primary-dark:   #4f46e5;
  --primary-light:  #e0e7ff;
  --accent:         #10b981;
  --danger:         #ef4444;
  --warning:        #f59e0b;
  --surface:        #ffffff;
  --surface-2:      #f8fafc;
  --border:         #e2e8f0;
  --text:           #0f172a;
  --text-muted:     #64748b;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:      0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:      0 10px 40px rgba(0,0,0,.12);
  --radius:         12px;
  --radius-sm:      8px;
  --transition:     .2s cubic-bezier(.4,0,.2,1);
}

/* ─── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--surface-2);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ─── Navbar ───────────────────────────────────────────────── */
.navbar-main {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: .75rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.navbar-main .navbar-brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary) !important;
  letter-spacing: -.3px;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.navbar-main .navbar-brand .brand-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

.navbar-main .nav-link {
  color: var(--text-muted) !important;
  font-weight: 500;
  font-size: .875rem;
  padding: .45rem .75rem !important;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.navbar-main .nav-link:hover,
.navbar-main .nav-link.active {
  color: var(--primary) !important;
  background: var(--primary-light);
}

.navbar-main .nav-link i { font-size: .8rem; }

/* Hamburger butonu */
.navbar-main .navbar-toggler {
  padding: .4rem .5rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1.5px solid var(--border) !important;
}

.navbar-main .navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}

/* Bootstrap'in beyaz SVG ikonunu koyu renkle değiştir */
.navbar-main .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%230f172a' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  width: 1.3em;
  height: 1.3em;
}

/* Mobil açılır menü arka planı */
@media (max-width: 767px) {
  .navbar-main .navbar-collapse {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .5rem .75rem;
    margin-top: .5rem;
    box-shadow: var(--shadow-md);
  }

  .navbar-main .nav-link {
    color: var(--text) !important;
    padding: .6rem .75rem !important;
  }

  .navbar-main .nav-link:hover {
    color: var(--primary) !important;
    background: var(--primary-light);
  }

  .btn-admin-nav {
    margin-top: .25rem;
    display: inline-flex !important;
    width: fit-content;
  }
}

.btn-admin-nav {
  background: var(--primary);
  color: #fff !important;
  font-size: .8rem;
  padding: .4rem 1rem !important;
  border-radius: 999px;
  font-weight: 600;
  transition: background var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}

.btn-admin-nav:hover {
  background: var(--primary-dark) !important;
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(99,102,241,.4);
}

/* ─── Main content ─────────────────────────────────────────── */
main { flex: 1 0 auto; padding: 2rem 0; }

/* Layout container da flex column zincirinde büyümeli */
body > div.container { flex: 1 0 auto; display: flex; flex-direction: column; }

/* ─── Footer ───────────────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  font-size: .8rem;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
  margin-top: auto;
}

/* ─── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: .9rem;
}

.card-header.dark {
  background: var(--text);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: .85rem;
  border-radius: var(--radius-sm);
  padding: .5rem 1.1rem;
  transition: all var(--transition);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.btn:focus { box-shadow: 0 0 0 3px rgba(99,102,241,.25); outline: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,.25);
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,.35);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,.2);
}
.btn-success:hover {
  background: #059669;
  color: #fff;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
  color: #fff;
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}
.btn-warning:hover {
  background: #d97706;
  color: #fff;
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--text-muted);
}
.btn-secondary:hover {
  background: #cbd5e1;
  color: var(--text);
}

.btn-sm { padding: .35rem .8rem; font-size: .78rem; }
.btn-lg { padding: .7rem 1.5rem; font-size: .95rem; }

/* ─── Forms ────────────────────────────────────────────────── */
.form-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .4rem;
}

.form-control, .form-select {
  font-family: 'Inter', sans-serif;
  font-size: .875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .55rem .9rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
  outline: none;
}

.form-control::placeholder { color: #b0bec5; }

/* ─── Tables ───────────────────────────────────────────────── */
.table {
  font-size: .875rem;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.table th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .85rem 1rem;
  border-bottom: 2px solid var(--border);
}

.table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr:hover { background: #f8faff; }

.table-responsive {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  background: var(--surface);
}

/* ─── Badges ───────────────────────────────────────────────── */
.badge {
  font-size: .7rem;
  font-weight: 600;
  padding: .3em .7em;
  border-radius: 999px;
  letter-spacing: .03em;
}

.bg-primary { background: var(--primary) !important; }
.bg-success { background: var(--accent) !important; }
.bg-danger  { background: var(--danger) !important; }
.bg-warning { background: var(--warning) !important; }
.bg-secondary { background: #94a3b8 !important; }

/* ─── Alerts ───────────────────────────────────────────────── */
.alert {
  border: none;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  padding: .9rem 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}

.alert-info    { background: #eff6ff; color: #1d4ed8; }
.alert-success { background: #f0fdf4; color: #166534; }
.alert-danger  { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }

/* ─── Page header ──────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.75rem;
}

.page-header h1, .page-header h2 {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
  margin: 0;
  letter-spacing: -.3px;
}

.page-header p {
  color: var(--text-muted);
  font-size: .9rem;
  margin: .4rem 0 0;
}

/* ─── Hero section ─────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  color: #fff;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -40px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: .5rem;
  position: relative;
  z-index: 1;
}

.hero p {
  font-size: 1rem;
  opacity: .85;
  margin: 0;
  position: relative;
  z-index: 1;
}

/* ─── List group ───────────────────────────────────────────── */
.list-group-item {
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  font-size: .875rem;
  transition: background var(--transition);
}

.list-group-item:last-child { border-bottom: none; }
.list-group-item:hover { background: var(--surface-2); }

/* ─── Genome search result item ────────────────────────────── */
.genome-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.genome-item:last-child { border-bottom: none; }
.genome-item:hover { background: #f8faff; }

.genome-item .genome-name {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .9rem;
  font-weight: 500;
}

.genome-item .genome-name .icon-pill {
  width: 32px; height: 32px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
}

/* ─── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ─── Animations ───────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeInUp .35s ease both; }

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { padding: 2rem 1.5rem; }
  .hero h1 { font-size: 1.5rem; }
}
