/* Oshiq Erkin Admin Panel Style Sheet */

:root {
  --color-bg-dark: #0a0e17;      /* Deep obsidian dark */
  --color-bg-sidebar: #101622;   /* Dark navy sidebar */
  --color-bg-card: #162032;      /* Lighter navy card */
  --color-border: rgba(197, 160, 89, 0.15); /* Gold tinted border */
  --color-gold: #c5a059;         /* Premium gold */
  --color-gold-hover: #e2c17c;   /* Lighter gold */
  --color-text: #e2e8f0;         /* Off-white text */
  --color-text-muted: #94a3b8;   /* Slate gray text */
  --color-primary: #10b981;      /* Emerald Green */
  --color-primary-light: #34d399;/* Lighter emerald */
  --color-danger: #ef4444;       /* Ruby red */
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--color-bg-dark);
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   LOGIN CARD
   ========================================================================== */
.login-wrapper {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #162238 0%, #0a0e17 100%);
  z-index: 1000;
  padding: 20px;
}

.login-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right, var(--color-gold), var(--color-primary));
}

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

.login-header h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--color-gold);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.login-header p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-top: 5px;
}

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition-normal);
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 10px rgba(197, 160, 89, 0.15);
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--color-gold) 0%, #b38c46 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: #0a0e17;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  margin-top: 10px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(197, 160, 89, 0.3);
  background: linear-gradient(135deg, var(--color-gold-hover) 0%, var(--color-gold) 100%);
}

.login-error {
  color: var(--color-danger);
  font-size: 0.85rem;
  margin-top: 12px;
  text-align: center;
  min-height: 20px;
}

.login-footer {
  text-align: center;
  margin-top: 30px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

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

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--color-bg-sidebar);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 30px 24px;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-logo h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--color-gold);
  font-size: 1.4rem;
  font-weight: 700;
}

.sidebar-logo span {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-normal);
}

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

.menu-item.active {
  background: rgba(197, 160, 89, 0.1);
  color: var(--color-gold);
  font-weight: 500;
  border-left: 3px solid var(--color-gold);
}

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

.btn-logout {
  width: 100%;
  padding: 12px;
  background: none;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: var(--color-danger);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-normal);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--color-danger);
}

/* Main Content Area */
.main-content {
  margin-left: 260px;
  flex-grow: 1;
  padding: 40px;
  max-width: 1400px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 24px;
}

.dashboard-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-gold);
}

.dashboard-header p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-bg-card);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.admin-profile .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-gold);
  color: #0a0e17;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.profile-role {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* TAB CONTENTS */
.tab-content {
  display: none;
}

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

/* ==========================================================================
   METRICS GRID
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.metric-card {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: var(--transition-normal);
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(197, 160, 89, 0.35);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.card-icon.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.card-icon.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.card-icon.gold { background: rgba(197, 160, 89, 0.15); color: var(--color-gold); }
.card-icon.red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.card-info {
  display: flex;
  flex-direction: column;
}

.card-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.card-info h3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.card-trend {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.card-trend.positive {
  color: #10b981;
  font-weight: 500;
}

/* ==========================================================================
   CHARTS GRID & CARDS
   ========================================================================== */
.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .charts-row {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.full-width-chart {
  grid-column: 1 / -1;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 16px;
}

.chart-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-gold);
}

.chart-body {
  position: relative;
  height: 320px;
  width: 100%;
}

/* ==========================================================================
   REAL-TIME LOGS TABLE
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.logs-table th {
  padding: 14px 20px;
  background-color: rgba(255, 255, 255, 0.02);
  border-bottom: 2px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}

.logs-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text);
}

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

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.info { background-color: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.status-badge.success { background-color: rgba(16, 185, 129, 0.15); color: #10b981; }
.status-badge.warning { background-color: rgba(197, 160, 89, 0.15); color: var(--color-gold); }

/* Live Pulse Badge */
.live-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.15);
  padding: 4px 10px;
  border-radius: 20px;
}

.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-danger);
  box-shadow: 0 0 0 rgba(239, 68, 68, 0.4);
  animation: pulseAnimation 2s infinite;
}

@keyframes pulseAnimation {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* ==========================================================================
   CMS ACTION BUTTONS
   ========================================================================== */
.btn-action {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-normal);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-action:hover {
  transform: translateY(-1px);
}
.btn-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-green { background-color: var(--color-primary); color: #0a0e17; }
.btn-green:hover { background-color: var(--color-primary-light); }
.btn-blue { background-color: #3b82f6; color: #ffffff; }
.btn-blue:hover { background-color: #60a5fa; }
.btn-red { background-color: var(--color-danger); color: #ffffff; }
.btn-red:hover { background-color: #f87171; }
.btn-gray { background-color: rgba(255,255,255,0.08); color: var(--color-text); }
.btn-gray:hover { background-color: rgba(255,255,255,0.15); }
.btn-gold { background-color: var(--color-gold); color: #0a0e17; }
.btn-gold:hover { background-color: var(--color-gold-hover); }

/* Table row actions wrapper */
.table-actions-cell {
  display: flex;
  gap: 8px;
}

.table-row-btn {
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 4px;
}

/* Interactive elements */
tr.clickable-row {
  cursor: pointer;
}
tr.clickable-row.selected {
  background-color: rgba(197, 160, 89, 0.08);
}

/* ==========================================================================
   CMS POPUP MODAL
   ========================================================================== */
.cms-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cms-modal.active {
  display: flex;
}
.cms-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(4px);
}
.cms-modal-content {
  position: relative;
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  z-index: 10;
  animation: modalFadeIn 0.3s ease;
}
.cms-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cms-modal-header h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.25rem;
  color: var(--color-gold);
}
.cms-modal-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  transition: var(--transition-fast);
}
.cms-modal-close:hover {
  color: var(--color-danger);
}
.cms-form {
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cms-form select, .cms-form textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition-normal);
}
.cms-form select:focus, .cms-form textarea:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 10px rgba(197, 160, 89, 0.15);
}
.cms-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
