/**
 * Admin Panel CSS - Ultra Lightweight & High Performance
 * Zero external frameworks, lightning fast, responsive
 */

:root {
  --admin-primary: #0f766e;
  --admin-primary-dark: #115e59;
  --admin-primary-light: #ccfbf1;
  --admin-bg: #f1f5f9;
  --admin-card-bg: #ffffff;
  --admin-text: #0f172a;
  --admin-muted: #64748b;
  --admin-border: #e2e8f0;
  --admin-gold: #f59e0b;
  --admin-danger: #ef4444;
  --admin-success: #10b981;
  --radius: 10px;
}

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

body {
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text);
  line-height: 1.5;
}

/* Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background-color: #0b1320;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.sidebar-title {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-badge {
  font-size: 0.72rem;
  background-color: #0f766e;
  color: #ccfbf1;
  padding: 2px 8px;
  border-radius: 9999px;
  display: inline-block;
  margin-top: 2px;
}

.sidebar-menu {
  list-style: none;
  padding: 20px 12px;
  flex-grow: 1;
}

.menu-item {
  margin-bottom: 6px;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.menu-link:hover {
  background-color: #162235;
  color: #ffffff;
}

.menu-link.active {
  background-color: var(--admin-primary);
  color: #ffffff;
  font-weight: 600;
}

.menu-link svg {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #1e293b;
}

.btn-sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f87171;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.2s;
}

.btn-sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* Main Content */
.admin-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.admin-topbar {
  background-color: #ffffff;
  border-bottom: 1px solid var(--admin-border);
  padding: 16px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--admin-text);
}

.admin-top-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn-view-site {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 20px;
  background-color: var(--admin-primary-light);
  color: var(--admin-primary-dark);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-view-site:hover {
  background-color: var(--admin-primary);
  color: #ffffff;
}

.admin-content {
  padding: 30px;
  flex-grow: 1;
}

/* Alert Boxes */
.alert {
  padding: 14px 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Cards & Widgets */
.card {
  background-color: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--admin-border);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--admin-text);
}

/* 50GB Storage Widget */
.storage-widget {
  background: linear-gradient(135deg, #042f2e 0%, #0f766e 100%);
  color: #ffffff;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 30px;
}

.storage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.storage-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

.storage-badge {
  background-color: rgba(254, 240, 138, 0.2);
  border: 1px solid rgba(254, 240, 138, 0.5);
  color: #fef08a;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 12px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2dd4bf, #f59e0b);
  border-radius: 9999px;
  transition: width 0.6s ease;
}

.storage-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: #ccfbf1;
}

/* Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: var(--admin-primary-light);
  color: var(--admin-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--admin-text);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--admin-muted);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

.admin-table th {
  background-color: #f8fafc;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--admin-muted);
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--admin-border);
  font-size: 0.92rem;
  vertical-align: middle;
}

.table-thumb {
  width: 60px;
  height: 45px;
  object-fit: cover;
  border-radius: 6px;
  background-color: #e2e8f0;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-video {
  background-color: #fee2e2;
  color: #b91c1c;
}

.badge-image {
  background-color: #e0f2fe;
  color: #0369a1;
}

.badge-trophy {
  background-color: #fef3c7;
  color: #92400e;
}

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

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--admin-text);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--admin-text);
  background-color: #ffffff;
}

.form-control:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--admin-muted);
  margin-top: 4px;
}

/* Buttons */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.btn-admin-primary {
  background-color: var(--admin-primary);
  color: #ffffff;
}

.btn-admin-primary:hover {
  background-color: var(--admin-primary-dark);
}

.btn-admin-danger {
  background-color: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.btn-admin-danger:hover {
  background-color: var(--admin-danger);
  color: #ffffff;
}

.btn-admin-sm {
  padding: 5px 12px;
  font-size: 0.82rem;
}

/* Media Grid for 50GB Manager */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.media-card {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  overflow: hidden;
  background-color: #ffffff;
  position: relative;
  display: flex;
  flex-direction: column;
}

.media-preview-box {
  width: 100%;
  padding-top: 65%;
  position: relative;
  background-color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-preview-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-card-body {
  padding: 10px;
  font-size: 0.82rem;
}

.media-card-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.media-card-size {
  color: var(--admin-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
  }
  .stat-grid {
    grid-template-columns: 1fr;
  }
}
