/* =============================================
   STOP STATION — ORTAK STILLER (common.css)
   Tüm sayfalar bu CSS'i paylaşır
   ============================================= */

:root {
  --header-h: 48px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Dark header */
  --header-bg: #1a1d2e;
  --header-bg-2: #252840;
  --header-text: #c8cad0;
  --header-text-bright: #ffffff;
  --header-border: rgba(255,255,255,0.08);

  /* Light surfaces */
  --bg: #f0f2f5;
  --surface: #ffffff;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --text: #1a1d23;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  /* Accents */
  --primary: #4f6ef7;
  --primary-hover: #3b5de7;
  --indigo: #6366f1;
  --blue: #3b82f6;
  --cyan: #06b6d4;
  --green: #22c55e;
  --emerald: #10b981;
  --yellow: #f59e0b;
  --amber: #f59e0b;
  --red: #ef4444;
  --purple: #8b5cf6;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
}

/* =============================================
   BASE
   ============================================= */

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* =============================================
   TOP HEADER BAR
   ============================================= */

.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--header-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  border-bottom: 1px solid var(--header-border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--header-text-bright);
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  text-decoration: none;
}

.header-brand:hover { color: var(--header-text-bright); }

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--primary);
  border-radius: 8px;
  font-size: 16px;
}

.brand-icon i { color: #fff; }

.header-nav-divider {
  width: 1px;
  height: 24px;
  background: var(--header-border);
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.header-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--header-text);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 16px;
  text-decoration: none;
}

.header-nav-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--header-text-bright);
}

.header-nav-btn.active {
  background: var(--primary);
  color: #fff;
}

/* Header Right */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(34,197,94,0.12);
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.25);
}

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

/* =============================================
   PAGE CONTENT (header altı)
   ============================================= */

.page-content {
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
  padding: 24px 28px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.page-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-light);
}

.page-header h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.page-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* =============================================
   CARDS
   ============================================= */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.card-head i { color: var(--primary); font-size: 15px; }
.card-head small { font-weight: 400; }
.card-body { padding: 16px; }
.card-body.p-0 { padding: 0; }

/* =============================================
   STAT CARDS
   ============================================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
}

.stat-body { display: flex; flex-direction: column; }
.stat-value { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-top: 2px; }
.stat-card .stat-icon { font-size: 28px; opacity: 0.15; }

.stat-blue::before { background: var(--blue); }
.stat-blue .stat-value, .stat-blue .stat-icon { color: var(--blue); }
.stat-cyan::before { background: var(--cyan); }
.stat-cyan .stat-value, .stat-cyan .stat-icon { color: var(--cyan); }
.stat-green::before { background: var(--green); }
.stat-green .stat-value, .stat-green .stat-icon { color: var(--green); }
.stat-yellow::before { background: var(--yellow); }
.stat-yellow .stat-value, .stat-yellow .stat-icon { color: var(--yellow); }
.stat-red::before { background: var(--red); }
.stat-red .stat-value, .stat-red .stat-icon { color: var(--red); }

/* =============================================
   FORM CONTROLS
   ============================================= */

.form-control, .form-select {
  font-size: 13px;
  border-radius: var(--radius-sm);
  border-color: var(--border);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.12);
}

.form-control-sm, .form-select-sm {
  font-size: 12.5px;
  padding: 6px 10px;
}

/* =============================================
   BUTTONS
   ============================================= */

.btn {
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-success { background: var(--green); border-color: var(--green); }
.btn-success:hover { background: #16a34a; border-color: #16a34a; }
.btn-outline-secondary { color: var(--text-secondary); border-color: var(--border); }
.btn-outline-secondary:hover { background: #f3f4f6; border-color: #d1d5db; color: var(--text); }

/* =============================================
   TABLE
   ============================================= */

.table {
  font-size: 12px;
  margin-bottom: 0;
}

.table thead th {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  padding: 8px 10px;
}

.table tbody td {
  padding: 6px 10px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-light);
}

/* =============================================
   TOAST
   ============================================= */

.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 40px 12px 16px;
  border-radius: 10px;
  background: #1e2235;
  color: #e0e0e0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.06);
  font-size: 13px;
  font-weight: 500;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  max-width: 380px;
}

.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-message { flex: 1; line-height: 1.4; }
.toast-close {
  position: absolute;
  top: 6px; right: 8px;
  background: none; border: none;
  color: #888; cursor: pointer;
  font-size: 13px; padding: 2px 4px;
  line-height: 1;
  border-radius: 4px;
}
.toast-close:hover { color: #fff; background: rgba(255,255,255,0.1); }

.toast-progress {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.06);
}
.toast-progress-bar {
  height: 100%;
  animation: toastProgress 3s linear forwards;
  border-radius: 0 0 0 10px;
}
.toast-progress-success { background: #22C55E; }
.toast-progress-error { background: #EF4444; }
.toast-progress-info { background: #3B82F6; }
.toast-progress-warning { background: #F59E0B; }

.toast-success { border-left: 3px solid #22C55E; }
.toast-error { border-left: 3px solid #EF4444; }
.toast-info { border-left: 3px solid #3B82F6; }
.toast-warning { border-left: 3px solid #F59E0B; }

.toast-fade-out { animation: toastSlideOut 0.3s ease forwards; }

@keyframes toastSlideIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastSlideOut {
  to { transform: translateX(100px); opacity: 0; }
}
@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* =============================================
   LOADING OVERLAY
   ============================================= */

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 32px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

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

/* =============================================
   ACTION LIST
   ============================================= */

.action-list-scroll { max-height: 340px; overflow-y: auto; }

.action-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.action-item:last-child { border-bottom: none; }
.action-item:hover { background: #f9fafb; }

.action-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-approve { background: #dcfce7; color: #166534; }
.badge-reject { background: #fee2e2; color: #991b1b; }
.badge-add { background: #dbeafe; color: #1e40af; }

.action-info { flex: 1; min-width: 0; }
.action-info .stop-name { font-weight: 600; color: var(--text); }
.action-info .meta { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.action-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* =============================================
   QUICK ACTIONS
   ============================================= */

.quick-actions { display: flex; flex-direction: column; gap: 8px; }

.quick-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  width: 100%;
  text-decoration: none;
  color: inherit;
}

.quick-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.08);
  color: inherit;
}

.quick-btn strong { display: block; font-size: 13px; color: var(--text); }
.quick-btn small { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

.quick-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}

.bg-indigo { background: var(--indigo); }
.bg-emerald { background: var(--emerald); }
.bg-amber { background: var(--amber); }
.bg-blue { background: var(--blue); }
.bg-cyan { background: var(--cyan); }
.bg-red { background: var(--red); }
.bg-green { background: var(--green); }
.bg-purple { background: var(--purple); }

/* =============================================
   FILTER BAR
   ============================================= */

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 20;
  position: relative;
}

.filter-bar .form-select { width: auto; min-width: 140px; max-width: 200px; }

/* =============================================
   DASHBOARD GRID
   ============================================= */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* =============================================
   MAP BOX
   ============================================= */

.map-box {
  width: 100%;
  height: 500px;
  background: #e5e7eb;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* =============================================
   MODAL
   ============================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-dialog {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #eee;
}

.modal-header h6 { margin: 0; }

.modal-body {
  padding: 14px 18px;
  overflow-y: auto;
  flex: 1;
}

/* =============================================
   SCROLLBAR
   ============================================= */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* =============================================
   EMPTY STATE
   ============================================= */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  color: #6b7280;
}

.empty-state i {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 13px;
  margin: 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
  .page-content { padding: 16px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
