/* --- SirajPlay Admin Studio Dedicated Stylesheet --- */

:root {
  --sidebar-width: 260px;
  --header-height: 70px;
}

.admin-body {
  background-color: #050505;
  background-image: radial-gradient(circle at 10% 20%, rgba(14, 168, 113, 0.08) 0%, transparent 60%);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  overflow: hidden;
  margin: 0;
  padding: 0;
  height: 100vh;
}

/* Grid Layout */
.admin-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--header-height) 1fr;
  grid-template-areas: 
    "sidebar header"
    "sidebar main";
  height: 100vh;
  width: 100vw;
}

/* --- SIDEBAR DESIGN --- */
.admin-sidebar {
  grid-area: sidebar;
  background: rgba(10, 10, 10, 0.6);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 30px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.brand-badge {
  background: var(--gradient-brand);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  box-shadow: 0 0 10px rgba(14, 168, 113, 0.4);
}

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

.menu-item {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition-fast) ease;
  text-align: left;
  width: 100%;
}

.menu-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2px;
}

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

.menu-item.active {
  color: #fff;
  background: var(--gradient-brand);
  box-shadow: 0 4px 15px rgba(12, 140, 90, 0.25);
}

.back-to-app-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* --- HEADER DESIGN --- */
.admin-header {
  grid-area: header;
  background: rgba(10, 10, 10, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 9;
}

.header-search {
  position: relative;
  max-width: 320px;
  width: 100%;
  display: flex;
  align-items: center;
}

.header-search svg {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.header-search input {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 50px;
  padding: 10px 16px 10px 38px;
  color: var(--text-primary);
  font-size: 0.85rem;
  width: 100%;
  transition: all var(--transition-normal);
}

.header-search input:focus {
  background: rgba(255, 255, 255, 0.04);
  border-color: #0ea871;
  box-shadow: 0 0 10px rgba(14, 168, 113, 0.15);
  outline: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.admin-time {
  font-family: monospace;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.admin-user-badge {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot-green {
  width: 6px;
  height: 6px;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  border-radius: 50%;
  animation: adminPulse 1.8s infinite ease-in-out;
}

@keyframes adminPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
}

/* --- MAIN DESIGN --- */
.admin-main {
  grid-area: main;
  padding: 32px;
  overflow-y: auto;
}

.admin-main::-webkit-scrollbar {
  width: 6px;
}

.admin-main::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.admin-main::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 168, 113, 0.2);
}

/* Tab Panels */
.admin-panel {
  display: none;
  animation: panelFadeIn 0.3s ease-out forwards;
}

.admin-panel.active {
  display: block;
}

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

.admin-panel h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

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

.metric-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition-normal);
}

.metric-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.03);
}

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

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

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.metric-value {
  font-size: 1.4rem;
  font-weight: 800;
}

/* Color Themes */
.card-purple .metric-icon { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.card-purple:hover { border-color: rgba(168, 85, 247, 0.2); box-shadow: 0 0 15px rgba(168, 85, 247, 0.05); }

.card-emerald .metric-icon { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.card-emerald:hover { border-color: rgba(16, 185, 129, 0.2); box-shadow: 0 0 15px rgba(16, 185, 129, 0.05); }

.card-teal .metric-icon { background: rgba(20, 184, 166, 0.1); color: #14b8a6; }
.card-teal:hover { border-color: rgba(20, 184, 166, 0.2); box-shadow: 0 0 15px rgba(20, 184, 166, 0.05); }

.card-magenta .metric-icon { background: rgba(236, 72, 153, 0.1); color: #ec4899; }
.card-magenta:hover { border-color: rgba(236, 72, 153, 0.2); box-shadow: 0 0 15px rgba(236, 72, 153, 0.05); }

/* --- DASHBOARD LAYOUT BLOCKS --- */
.dashboard-details-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
}

.dashboard-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-lg);
  padding: 24px;
}

.dashboard-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-card h3 svg {
  width: 18px;
  height: 18px;
  color: #0ea871;
}

/* Logging Terminal Console */
.terminal-log-container {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-md);
  padding: 16px;
  font-family: monospace;
  font-size: 0.8rem;
  height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.terminal-log-container::-webkit-scrollbar {
  width: 4px;
}

.terminal-log-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.05);
}

.log-line {
  line-height: 1.4;
}

.log-line.system { color: #c084fc; }
.log-line.user { color: #34d399; }
.log-line.error { color: #f87171; }
.log-line.info { color: #60a5fa; }

/* Quick Actions Card */
.actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.action-btn, .action-btn-link {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 12px;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all var(--transition-fast) ease;
  text-decoration: none;
}

.action-btn svg, .action-btn-link svg {
  width: 16px;
  height: 16px;
}

.action-btn:hover, .action-btn-link:hover {
  background: rgba(14, 168, 113, 0.05);
  border-color: #0ea871;
  color: var(--text-primary);
}

/* --- DATATABLE DESIGN --- */
.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.panel-header-row h2 {
  margin-bottom: 0;
}

.table-card {
  padding: 0;
  overflow: hidden;
}

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

.admin-table th {
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.admin-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

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

.table-poster {
  height: 48px;
  width: 34px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.td-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 180px;
}

.td-genre-badge {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.td-url-code {
  font-family: monospace;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  padding: 4px 8px;
  color: #34d399;
  display: inline-block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.td-actions {
  display: flex;
  gap: 8px;
}

.action-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-edit { color: #60a5fa; background: rgba(96, 165, 250, 0.06); }
.btn-edit:hover { background: rgba(96, 165, 250, 0.15); }

.btn-delete { color: #f87171; background: rgba(248, 113, 113, 0.06); }
.btn-delete:hover { background: rgba(248, 113, 113, 0.15); }

.loading-td {
  text-align: center;
  padding: 40px !important;
  color: var(--text-muted);
}

/* --- SETTINGS DESIGN --- */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.setting-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input, .form-group select, .form-group textarea {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-md);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  transition: border var(--transition-fast) ease;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: #0ea871;
  outline: none;
}

.maintenance-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.maintenance-actions button {
  width: 100%;
}

/* --- MODAL DESIGN --- */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1;
}

.admin-modal-card {
  background: rgba(15, 15, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(32px);
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 580px;
  position: relative;
  z-index: 2;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast) ease;
}

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

.modal-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-form textarea {
  height: 80px;
  resize: vertical;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 10px;
}
