/* ==========================================================================
   FUTURE WAVE ANALYSIS — Administrative Interface Stylesheet
   Theme: High-Conviction Tactical Terminal / Dark Mode Glassmorphism
   ========================================================================== */

/* ==========================================================================
   ADMIN INITIAL SETUP MODAL (First-Time Admin Account Creation)
   ========================================================================== */
#modalAdminSetup .modal-dialog {
  max-width: 480px;
  border: 1px solid rgba(45, 212, 191, 0.45);
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.85), 0 0 40px rgba(45, 212, 191, 0.2);
  background: linear-gradient(180deg, #0d223a 0%, #071321 100%);
  position: relative;
  overflow: hidden;
}

#modalAdminSetup .modal-dialog::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f59e0b, #2dd4bf, #3b82f6);
}

.admin-setup-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.admin-setup-alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid rgba(45, 212, 191, 0.22);
  font-size: 0.825rem;
  line-height: 1.5;
  color: #94a3b8;
  margin-bottom: 1.25rem;
}

.admin-setup-alert strong {
  color: var(--tide);
}

.admin-error-box {
  display: none;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  color: #fca5a5;
  font-size: 0.825rem;
  line-height: 1.4;
}

.admin-dismiss-link {
  display: block;
  text-align: center;
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--mist);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

.admin-dismiss-link:hover {
  color: var(--foreground);
}

/* ==========================================================================
   ADMIN AUTH MODAL
   ========================================================================== */
#modalAdminAuth .modal-dialog {
  max-width: 440px;
  border: 1px solid rgba(45, 212, 191, 0.4);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 35px rgba(45, 212, 191, 0.15);
  background: linear-gradient(180deg, #0b1c30 0%, #071321 100%);
}

.admin-auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.3);
  color: var(--tide);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.admin-auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.admin-auth-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--foreground);
}

.admin-auth-subtitle {
  font-size: 0.8125rem;
  color: var(--mist);
  margin-top: 0.35rem;
}

.admin-status-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 0.75rem;
  color: var(--mist);
}

.admin-status-pill .status-value {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--foreground);
}

/* ==========================================================================
   ADMIN MAIN COMMAND CENTER MODAL
   ========================================================================== */
#modalAdminPanel.modal-overlay {
  padding: 1.5rem;
  background: rgba(4, 11, 20, 0.94);
}

#modalAdminPanel .modal-dialog {
  max-width: 1200px;
  width: 96vw;
  height: 90vh;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  background: #081525;
  border: 1px solid rgba(45, 212, 191, 0.25);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9), 0 0 50px rgba(45, 212, 191, 0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.75rem;
  background: #0b1c31;
  border-bottom: 1px solid var(--line-strong);
  flex-shrink: 0;
}

.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-logo-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-logo-badge img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.admin-panel-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--foreground);
}

.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-db-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--bull);
}

.admin-db-indicator.local-mode {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.3);
  color: var(--signal);
}

/* Admin Layout (Sidebar Tabs + Content Area) */
.admin-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.admin-sidebar {
  width: 240px;
  background: #071424;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem 0.75rem;
  flex-shrink: 0;
}

.admin-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--mist);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-nav-btn:hover {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.04);
}

.admin-nav-btn.active {
  color: var(--primary);
  background: rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.25);
}

.admin-nav-btn svg {
  flex-shrink: 0;
}

.admin-sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  color: var(--mist-dim);
  text-align: center;
}

/* Admin Main Content Body */
.admin-content {
  flex: 1;
  min-width: 0;
  padding: 1.75rem;
  overflow-y: auto;
  background: #081525;
}

.admin-tab-pane {
  display: none;
  animation: fadeInPane 0.2s ease-in-out;
}

.admin-tab-pane.active {
  display: block;
}

@keyframes fadeInPane {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.admin-pane-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--foreground);
}

.admin-pane-desc {
  font-size: 0.8125rem;
  color: var(--mist);
  margin-top: 0.25rem;
}

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

/* Metric / Stat Cards */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.admin-stat-card {
  padding: 1.25rem;
  background: #0d1e33;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  position: relative;
  overflow: hidden;
}

.admin-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--tide);
  opacity: 0.6;
}

.admin-stat-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mist);
}

.admin-stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--foreground);
  margin: 0.35rem 0;
}

.admin-stat-sub {
  font-size: 0.75rem;
  color: var(--mist-dim);
}

/* ==========================================================================
   TICKERS & ARTICLES DATA TABLES & LISTS
   ========================================================================== */
.admin-table-container {
  background: #0b1a2c;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-subtle);
}

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

.admin-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.85rem 1rem;
  color: var(--mist);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
}

.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--foreground);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.admin-action-btn-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon-sm {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--mist);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon-sm:hover {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--line-strong);
}

.btn-icon-sm.delete:hover {
  color: #fff;
  background: rgba(248, 113, 113, 0.2);
  border-color: var(--risk);
}

/* Form Groups in Admin */
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.admin-form-card {
  background: #0b1a2c;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-form-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--foreground);
}

.admin-preview-box {
  background: rgba(7, 19, 33, 0.6);
  border: 1px dashed var(--line-highlight);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
}

.admin-preview-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tide);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

/* Future expansion module cards */
.admin-future-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.admin-future-card {
  background: #0b1a2c;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
}

.admin-future-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(96, 165, 250, 0.15);
  color: var(--sky);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

/* Modals inside Admin (Sub-modals like Ticker Editor & Article Editor) */
.admin-submodal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.admin-submodal.open {
  opacity: 1;
  visibility: visible;
}

.admin-submodal-dialog {
  width: 100%;
  max-width: 650px;
  max-height: 85vh;
  overflow-y: auto;
  background: #0b1a2d;
  border: 1px solid rgba(45, 212, 191, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
  padding: 1.75rem;
}

.admin-submodal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

/* Article Reader Modal */
#modalArticleReader .modal-dialog {
  max-width: 760px;
  max-height: 85vh;
  overflow-y: auto;
  background: #071321;
  border: 1px solid var(--line-highlight);
}

.article-reader-header {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.article-reader-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--mist);
}

.article-reader-body {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--foreground-muted);
}

.article-reader-body p {
  margin-bottom: 1.25rem;
}

.article-reader-body h3, .article-reader-body h4 {
  color: var(--foreground);
  margin: 1.75rem 0 0.75rem 0;
  font-family: var(--font-display);
}

.article-reader-body ul, .article-reader-body ol {
  margin: 1rem 0 1.25rem 1.5rem;
}

.article-reader-body li {
  margin-bottom: 0.4rem;
}

/* Responsive queries */
@media (max-width: 900px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 0.75rem;
  }
  .admin-nav-list {
    flex-direction: row;
    overflow-x: auto;
  }
  .admin-nav-btn {
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
  }
  .admin-sidebar-footer {
    display: none;
  }
}
