/* CMS Admin Dashboard Stylesheet - Horizon Digital */

/* Custom Variables */
:root {
  --font-family: 'Outfit', sans-serif;
  --bg-primary: #070913;
  --bg-sidebar: #0b0e22;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --secondary: #06b6d4;
  
  --glass-bg: rgba(15, 22, 42, 0.45);
  --glass-bg-hover: rgba(20, 30, 55, 0.65);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-border-hover: rgba(255, 255, 255, 0.15);
  
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  
  --status-pending: #f59e0b; /* Orange */
  --status-contacted: #10b981; /* Green */
  --status-ignored: #64748b; /* Grey */
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Auth Screening View */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: var(--bg-primary);
  padding: 24px;
}

.glow-sphere {
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  filter: blur(100px);
  opacity: 0.3;
  z-index: 0;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 40px;
  position: relative;
  z-index: 1;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo {
  height: 48px;
  margin-bottom: 24px;
}

.auth-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group.span-2 {
  grid-column: span 2;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
}

.form-input.text-area {
  resize: vertical;
}

.input-tip {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all 0.3s;
  gap: 8px;
}

.btn-block {
  width: 100%;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  border: 1px solid var(--glass-border-hover);
  color: var(--text-primary);
  background: rgba(255,255,255,0.01);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.06);
}

.btn-icon {
  width: 14px;
  height: 14px;
}

.error-banner {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

/* Dashboard Structure */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.dashboard-sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 10;
}

.sidebar-brand {
  padding: 24px;
  border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo {
  height: 36px;
  object-fit: contain;
}

.sidebar-nav {
  padding: 24px 12px;
  flex-grow: 1;
}

.sidebar-nav ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-tab {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  text-align: left;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.nav-tab.active {
  background: rgba(124, 58, 237, 0.15);
  color: var(--text-primary);
  font-weight: 600;
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.nav-tab svg {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  padding: 20px 16px;
  border-top: 1px solid var(--glass-border);
}

/* Main Content Workspace */
.dashboard-main {
  flex-grow: 1;
  margin-left: 260px;
  padding: 40px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.header-welcome h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.header-welcome p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.user-profile {
  display: flex;
  align-items: center;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.user-badge svg {
  width: 14px;
  height: 14px;
  color: var(--secondary);
}

/* Metrics Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
}

.metric-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon-box svg {
  width: 22px;
  height: 22px;
}

.metric-icon-box.orange {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.metric-icon-box.blue {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.metric-icon-box.green {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.metric-icon-box.purple {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
}

.metric-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.metric-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Tab Panes */
.tab-pane {
  display: none;
}

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

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.pane-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.pane-header p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Data Tables */
.table-container {
  overflow-x: auto;
  border-radius: var(--border-radius-md);
  background: rgba(12, 16, 33, 0.5);
}

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

.data-table th {
  padding: 16px 24px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

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

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 50px;
  text-transform: uppercase;
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--status-pending);
}

.status-badge.contacted {
  background: rgba(16, 185, 129, 0.1);
  color: var(--status-contacted);
}

.status-badge.ignored {
  background: rgba(100, 116, 139, 0.15);
  color: var(--status-ignored);
}

/* Action Icon Buttons */
.action-btns {
  display: inline-flex;
  gap: 8px;
  justify-content: flex-end;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s;
  cursor: pointer;
}

.action-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
}

.action-btn.edit-btn:hover {
  color: var(--secondary);
}

.action-btn.delete-btn:hover {
  color: #ef4444;
}

.action-btn svg {
  width: 14px;
  height: 14px;
}

/* Settings Form Container */
.form-container {
  padding: 40px;
  background: rgba(12, 16, 33, 0.5);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 30px;
}

.form-actions {
  border-top: 1px solid var(--glass-border);
  padding-top: 24px;
}

/* File Upload Widget */
.file-upload-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.hidden-file-input {
  display: none;
}

.file-name-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-all;
}

.image-preview-box {
  width: 80px;
  height: 80px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--glass-border);
  background: #0d1024;
  overflow: hidden;
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Table Team Photo */
.table-photo-box {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: #0d1024;
  border: 1px solid var(--glass-border);
}

.table-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  background: rgba(4, 6, 14, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  width: 100%;
  max-width: 540px;
  padding: 36px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s;
}

.modal.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--text-secondary);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 24px;
}

/* Lead Detail Display */
.lead-details-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-row {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  padding-bottom: 10px;
  font-size: 0.85rem;
}

.detail-name {
  width: 100px;
  font-weight: 500;
  color: var(--text-secondary);
}

.detail-value {
  flex-grow: 1;
  color: var(--text-primary);
}

.detail-value a {
  color: var(--secondary);
}

.detail-value a:hover {
  text-decoration: underline;
}

.detail-row-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
}

.detail-message-box {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 16px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}

.text-danger {
  color: #ef4444 !important;
}

/* Glass Card styling base */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  box-shadow: var(--card-shadow);
}

/* Responsive Rules */
@media (max-width: 991px) {
  .dashboard-wrapper {
    flex-direction: column;
  }
  
  .dashboard-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
  }
  
  .sidebar-nav {
    padding: 12px;
  }
  
  .sidebar-nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav-tab {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  
  .dashboard-main {
    margin-left: 0;
    padding: 24px;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-group.span-2 {
    grid-column: span 1;
  }
  
  .modal-content {
    padding: 24px;
  }
  
  .pane-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .sidebar-nav ul {
    gap: 4px;
  }
  
  .nav-tab span {
    display: none; /* Icon-only on very small devices */
  }
}
