/* SMS Bridge Pro - Master Stylesheet */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #38bdf8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;

  /* Light Theme */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-hover: #1e293b;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --table-hover: #f1f5f9;
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --header-bg: #ffffff;
}

[data-theme="dark"] {
  --bg-body: #0b0f19;
  --bg-card: #151d30;
  --bg-sidebar: #0b1120;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #38bdf8;
  --sidebar-hover: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --table-hover: #1e293b;
  --input-bg: #111827;
  --input-border: #334155;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --header-bg: #151d30;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  transition: background-color 0.25s ease, color 0.25s ease;
  min-height: 100vh;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 270px;
  background-color: var(--bg-sidebar);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  z-index: 1000;
}

.sidebar .brand {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .brand .logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.sidebar .brand .brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.sidebar .nav-list {
  padding: 1rem 0.75rem;
  list-style: none;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar .nav-item {
  margin-bottom: 0.25rem;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
  background-color: var(--sidebar-hover);
  color: #ffffff;
}

.sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.25), rgba(37, 99, 235, 0.05));
  color: #38bdf8;
  font-weight: 600;
  border-left: 3px solid #38bdf8;
}

.sidebar .nav-link i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
}

.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Header */
.topbar {
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Cards */
.card-custom {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.stat-icon.green { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.stat-icon.yellow { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.stat-icon.red { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.12); color: #06b6d4; }
.stat-icon.purple { background: rgba(168, 85, 247, 0.12); color: #a855f7; }

/* Tables */
.table-custom {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text-main);
}

.table-custom th {
  background-color: var(--bg-body);
  color: var(--text-muted);
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}

.table-custom td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  font-size: 0.9rem;
}

.table-custom tr:hover td {
  background-color: var(--table-hover);
}

/* Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.775rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-pending { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.badge-claimed { background: rgba(6, 182, 212, 0.15); color: #0891b2; }
.badge-sending { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.badge-sent { background: rgba(16, 185, 129, 0.15); color: #059669; }
.badge-delivery_confirmed { background: rgba(16, 185, 129, 0.25); color: #047857; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-failed { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.badge-cancelled { background: rgba(148, 163, 184, 0.2); color: #64748b; }

/* Buttons */
.btn-primary-custom {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: none;
  color: #fff;
  font-weight: 500;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.btn-primary-custom:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.35);
}

/* Forms */
.form-control-custom {
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-main);
  border-radius: 8px;
  padding: 0.65rem 0.95rem;
  font-size: 0.925rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control-custom:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  outline: none;
  background-color: var(--input-bg);
  color: var(--text-main);
}

/* Code Snippet */
.code-block {
  background-color: #0f172a;
  color: #38bdf8;
  padding: 1rem;
  border-radius: 8px;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  position: relative;
}

/* Responsive */
@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    left: -270px;
    height: 100vh;
  }
  .sidebar.show {
    left: 0;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
  .sidebar-backdrop.show {
    display: block;
  }
}
