/**
 * Bridging Silence Admin Dashboard - Enterprise Styles
 * Clean, high-contrast, accessible corporate theme. No AI slop or weird neon gradients.
 */

:root {
  --bs-font-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-width: 260px;
  --sidebar-bg: #0f172a; /* Slate 900 */
  --sidebar-hover: #1e293b; /* Slate 800 */
  --sidebar-active: #2563eb; /* Royal Blue */
  --sidebar-text: #94a3b8; /* Slate 400 */
  --sidebar-text-active: #ffffff;
  
  --topbar-height: 64px;
  --topbar-bg: #ffffff;
  --body-bg: #f8fafc; /* Slate 50 */
  
  --card-border: #e2e8f0; /* Slate 200 */
  --text-main: #0f172a;
  --text-muted: #64748b;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

body {
  font-family: var(--bs-font-sans-serif);
  background-color: var(--body-bg);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

/* -------------------------------------------------------------------------- */
/* Layout Structure                                                           */
/* -------------------------------------------------------------------------- */
#app-layout {
  display: flex;
  min-height: 100vh;
}

#sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  transition: transform 0.25s ease-in-out;
  border-right: 1px solid #1e293b;
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid #1e293b;
}

.sidebar-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sidebar-brand i {
  color: #38bdf8;
  font-size: 1.35rem;
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #64748b;
  padding: 0.75rem 0.75rem 0.35rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  color: var(--sidebar-text);
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
  margin-bottom: 0.2rem;
}

.sidebar-nav .nav-link i {
  font-size: 1.1rem;
  width: 1.25rem;
  text-align: center;
}

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

.sidebar-nav .nav-link.active {
  background-color: var(--sidebar-active);
  color: #ffffff;
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Main Content Area */
#main-wrapper {
  flex-grow: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.25s ease-in-out;
}

#topbar {
  height: var(--topbar-height);
  background-color: var(--topbar-bg);
  border-bottom: 1px solid var(--card-border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
}

#page-content {
  padding: 1.75rem;
  flex-grow: 1;
}

/* -------------------------------------------------------------------------- */
/* Cards & Containers                                                         */
/* -------------------------------------------------------------------------- */
.card {
  background-color: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  margin-bottom: 1.25rem;
}

.card-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--card-border);
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 1.25rem;
}

/* Metric / Stat Card */
.stat-card {
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 1.25rem;
  background-color: #ffffff;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

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

/* -------------------------------------------------------------------------- */
/* Tables & Listings                                                          */
/* -------------------------------------------------------------------------- */
.table {
  color: var(--text-main);
  vertical-align: middle;
  margin-bottom: 0;
}

.table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--card-border);
  padding: 0.75rem 1rem;
}

.table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
}

.table tbody tr:hover {
  background-color: #f8fafc;
}

/* -------------------------------------------------------------------------- */
/* Status Badges                                                              */
/* -------------------------------------------------------------------------- */
.badge-clean {
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.3em 0.65em;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-clean.badge-success {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-clean.badge-primary {
  background-color: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.badge-clean.badge-warning {
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-clean.badge-danger {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.badge-clean.badge-secondary {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* -------------------------------------------------------------------------- */
/* Buttons & Forms                                                            */
/* -------------------------------------------------------------------------- */
.btn {
  font-weight: 500;
  font-size: 0.88rem;
  padding: 0.45rem 0.95rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease-in-out;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.form-control, .form-select {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem;
  color: var(--text-main);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
}

/* -------------------------------------------------------------------------- */
/* Video Preview Component                                                    */
/* -------------------------------------------------------------------------- */
.video-preview-wrapper {
  background-color: #000000;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-preview-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* -------------------------------------------------------------------------- */
/* Modal Dialog & Form Scrolling Fixes                                        */
/* -------------------------------------------------------------------------- */
.modal-dialog-scrollable .modal-content {
  max-height: calc(100vh - 3.5rem);
  display: flex;
  flex-direction: column;
}

.modal-dialog-scrollable form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal-dialog-scrollable .modal-body {
  overflow-y: auto !important;
  flex: 1 1 auto;
  max-height: 72vh;
  padding: 1.5rem;
}

/* -------------------------------------------------------------------------- */
/* Login Page Specialized Styles                                              */
/* -------------------------------------------------------------------------- */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1f5f9; /* Clean light slate background */
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

/* -------------------------------------------------------------------------- */
/* Responsive Toggles                                                         */
/* -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  #sidebar {
    transform: translateX(-100%);
  }
  #sidebar.show {
    transform: translateX(0);
  }
  #main-wrapper {
    margin-left: 0;
  }
}
