/* ==========================================================================
   CSS STYLESHEET - FR7TV ADMIN DASHBOARD
   Design Theme: Brushed Metallic Gold, Matte Dark Titanium, Dark Obsidian
   ========================================================================== */

:root {
  --bg-obsidian: #050507;
  --bg-titanium: #0f1013;
  --bg-card: rgba(22, 23, 29, 0.7);
  --bg-active: rgba(212, 175, 55, 0.08);
  --border-gold-low: rgba(212, 175, 55, 0.15);
  --border-gold-high: rgba(212, 175, 55, 0.4);
  --primary-gold: #D4AF37; /* Burnished Gold */
  --secondary-champagne: #F5E6C4; /* Soft Highlight */
  --text-primary: #ffffff;
  --text-muted: #a0a5b5;
  --text-gold-muted: #cbb27a;
  --color-green: #22c55e;
  --color-red: #ef4444;
  --color-blue: #3b82f6;
  --color-purple: #a855f7;
  --glass-blur: blur(16px);
}

/* Reset and Globals */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Tajawal', 'Cairo', sans-serif;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-gold) rgba(255, 255, 255, 0.02);
}

body {
  background-color: var(--bg-obsidian);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: var(--primary-gold);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-champagne);
}

/* Utility classes */
.hidden {
  display: none !important;
}

.text-glow {
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.6), 0 0 20px rgba(212, 175, 55, 0.3);
}

.box-glow {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 15px rgba(212, 175, 55, 0.15), inset 0 0 10px rgba(212, 175, 55, 0.05);
}

.glass-panel {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-gold-low);
  border-radius: 16px;
}

.gold-text {
  color: var(--primary-gold);
  background: linear-gradient(135deg, var(--primary-gold) 0%, var(--secondary-champagne) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.text-muted {
  color: var(--text-muted);
  font-size: 13px;
}

/* ==========================================================================
   LOGIN CARD PAGE
   ========================================================================== */
.login-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top right, rgba(212, 175, 55, 0.12), transparent 45%), radial-gradient(circle at bottom left, rgba(15, 16, 19, 0.95), var(--bg-obsidian));
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 40px 35px;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-header {
  text-align: center;
  margin-bottom: 35px;
}

.gold-logo-wrap {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.2) 0%, transparent 75%);
  border: 2px dashed var(--primary-gold);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 15px;
  animation: pulseGlow 3s infinite ease-in-out;
}

.main-glow-icon {
  font-size: 32px;
  color: var(--primary-gold);
}

.login-header h2 {
  font-size: 26px;
  letter-spacing: -0.5px;
  margin-bottom: 5px;
}

/* Form Styles */
.input-group {
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-gold-muted);
}

.input-icon-wrap {
  position: relative;
  width: 100%;
}

.input-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-gold-muted);
  opacity: 0.7;
  font-size: 16px;
}

.input-icon-wrap input, 
.form-group input, 
.form-group textarea,
.form-group select {
  width: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-gold-low);
  padding: 12px 48px 12px 16px; /* Extra right padding for icon in login */
  border-radius: 12px;
  color: var(--text-primary);
  outline: none;
  font-size: 15px;
  transition: all 0.3s ease;
}

.form-group input, 
.form-group textarea,
.form-group select {
  padding: 12px 16px; /* Regular padding */
}

.input-icon-wrap input:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary-gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
  background-color: rgba(0, 0, 0, 0.5);
}

/* Buttons */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-gold) 0%, var(--secondary-champagne) 100%);
  color: #000000;
  border: none;
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-gold-low);
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-gold);
}

/* Alerts */
.alert-box {
  margin-top: 20px;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}

.error-alert {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-red);
}

.success-alert {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--color-green);
}

.info-alert {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--color-blue);
}

/* ==========================================================================
   MAIN SYSTEM WRAPPER
   ========================================================================== */
.dashboard-wrapper {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* SIDEBAR PANEL */
.sidebar {
  width: 280px;
  background-color: var(--bg-titanium);
  border-left: 1px solid var(--border-gold-low);
  display: flex;
  flex-direction: column;
  padding: 30px 20px;
  flex-shrink: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 25px;
}

.brand-glow {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.1);
  border: 1.5px solid var(--primary-gold);
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand-icon {
  font-size: 20px;
  color: var(--primary-gold);
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 18px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.menu-item:hover {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}

.menu-item.active {
  background-color: var(--bg-active);
  color: var(--primary-gold);
  border-color: rgba(212, 175, 55, 0.25);
  box-shadow: inset 0 0 10px rgba(212, 175, 55, 0.05);
}

.menu-item i {
  font-size: 16px;
}

.sidebar-footer {
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-logout {
  width: 100%;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--color-red);
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  transform: translateY(-1px);
}

/* CONTENT VIEWPORT */
.main-content {
  flex-grow: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 35px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 20px;
}

.content-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.status-indicator-box {
  background-color: var(--bg-titanium);
  padding: 10px 18px;
  border-radius: 30px;
  border: 1px solid var(--border-gold-low);
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.pulse-dot.active {
  background-color: var(--color-green);
  box-shadow: 0 0 10px var(--color-green);
  animation: pulseDot 2s infinite;
}

.pulse-dot.error {
  background-color: var(--color-red);
  box-shadow: 0 0 10px var(--color-red);
}

.status-label {
  font-size: 12px;
  font-weight: 700;
}

/* ==========================================================================
   TAB PANEL WORKSPACES
   ========================================================================== */
.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease;
  flex-direction: column;
  gap: 30px;
}

.tab-panel.active {
  display: flex;
}

.tab-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* OVERVIEW STATS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.stat-card {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
}

.stat-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #000000;
  font-size: 20px;
}

.bg-gold { background: linear-gradient(135deg, var(--primary-gold), var(--secondary-champagne)); }
.bg-green { background: linear-gradient(135deg, var(--color-green), #86efac); }
.bg-blue { background: linear-gradient(135deg, var(--color-blue), #93c5fd); }
.bg-purple { background: linear-gradient(135deg, var(--color-purple), #d8b4fe); }

.stat-info h3 {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-info p {
  font-size: 18px;
  font-weight: 700;
}

/* GRIDS & LAYOUT PANELS */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

.dashboard-split {
  display: flex;
  gap: 30px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.form-row {
  display: flex;
  gap: 20px;
}

.max-height-600 { max-height: 600px; }
.overflow-y { overflow-y: auto; }

.info-card, .quick-notif-card, .settings-card {
  padding: 30px;
  border-radius: 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-gold-low);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-card h2, .quick-notif-card h2, .settings-card h2 {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-card p, .settings-card p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-muted);
}

.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-top: 20px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.flow-node {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  padding: 12px 18px;
  border-radius: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  max-width: 140px;
}

.flow-node.active {
  border-color: var(--primary-gold);
  background-color: var(--bg-active);
  color: var(--primary-gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
}

.flow-arrow {
  color: var(--text-gold-muted);
  opacity: 0.5;
  font-size: 18px;
}

/* ==========================================================================
   FORMS & CONFIG PAGES
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-gold-muted);
}

.form-help {
  font-size: 11px;
  color: var(--text-muted);
}

.button-row {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.toggle-switch-wrapper {
  display: flex;
  gap: 20px;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--border-gold-low);
  width: fit-content;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.radio-label input {
  display: none;
}

.radio-label input:checked + span {
  color: var(--primary-gold);
}

.radio-label:has(input:checked) {
  background-color: var(--bg-active);
  border: 1px solid rgba(212, 175, 55, 0.15);
}

/* FILE UPLOAD DROPZONE */
.upload-dropzone {
  border: 2px dashed rgba(212, 175, 55, 0.3);
  background-color: rgba(212, 175, 55, 0.02);
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-dropzone:hover {
  border-color: var(--primary-gold);
  background-color: rgba(212, 175, 55, 0.05);
}

.cloud-icon {
  font-size: 40px;
  color: var(--primary-gold);
  margin-bottom: 15px;
  opacity: 0.8;
}

.upload-dropzone p {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.image-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
  background-color: rgba(0,0,0,0.3);
  padding: 15px;
  border-radius: 12px;
  border: 1px solid var(--border-gold-low);
  width: fit-content;
}

.image-preview-wrap img {
  max-width: 250px;
  max-height: 250px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}

.btn-danger-sm {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--color-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  transition: all 0.3s ease;
}

.btn-danger-sm:hover {
  background-color: rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   NOTIFICATIONS HISTORY LIST
   ========================================================================== */
.notif-history-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.notif-item {
  padding: 16px;
  border-radius: 12px;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
}

.notif-item.type-info { border-right: 4px solid var(--color-blue); }
.notif-item.type-warning { border-right: 4px solid var(--color-red); }
.notif-item.type-ad { border-right: 4px solid var(--primary-gold); }

.notif-item-body h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.notif-item-body p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.notif-item-body span {
  font-size: 10px;
  color: var(--text-gold-muted);
  opacity: 0.7;
}

.btn-delete-notif {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.btn-delete-notif:hover {
  color: var(--color-red);
  opacity: 1;
}

.empty-list {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

/* ==========================================================================
   ADMINS MANAGEMENT TABLE
   ========================================================================== */
.table-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-primary-sm {
  background: linear-gradient(135deg, var(--primary-gold) 0%, var(--secondary-champagne) 100%);
  color: #000;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.btn-primary-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-top: 15px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}

.admin-table th, .admin-table td {
  padding: 16px 20px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.admin-table th {
  color: var(--text-gold-muted);
  font-weight: 700;
  background-color: rgba(255, 255, 255, 0.01);
}

.admin-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.01);
}

.badge-role {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background-color: var(--bg-active);
  color: var(--primary-gold);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

/* ==========================================================================
   MODAL WINDOW DIALOGS
   ========================================================================== */
.modal-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: var(--glass-blur);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 460px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 15px;
}

.modal-header h3 {
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  transition: all 0.3s ease;
}

.btn-close-modal:hover {
  color: var(--color-red);
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulseGlow {
  0% { box-shadow: 0 0 10px rgba(212, 175, 55, 0.15); border-color: rgba(212, 175, 55, 0.4); }
  50% { box-shadow: 0 0 25px rgba(212, 175, 55, 0.35); border-color: var(--primary-gold); }
  100% { box-shadow: 0 0 10px rgba(212, 175, 55, 0.15); border-color: rgba(212, 175, 55, 0.4); }
}

@keyframes pulseDot {
  0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1.1); opacity: 0.8; box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Status Badges */
.badge-success {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background-color: rgba(34, 197, 94, 0.1);
  color: var(--color-green);
  border: 1px solid rgba(34, 197, 94, 0.2);
  display: inline-block;
}

.badge-danger {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--color-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
  display: inline-block;
}

.badge-secondary {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-block;
}
