/* ==========================================================================
   FUNKTOGRAPHER - Admin Backoffice Stylesheet
   ========================================================================== */

/* Brand Fonts */
@font-face {
  font-family: 'Fifties Movies';
  src: url('../fonts/Fifties-Movies.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Dechorian';
  src: url('../fonts/Dechorian.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nexa';
  src: url('../fonts/Nexa-Book.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nexa';
  src: url('../fonts/Nexa-Regular.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nexa';
  src: url('../fonts/Nexa-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --adm-bg: #120826;
  --adm-sidebar: #170b30;
  --adm-card: #201142;
  --adm-border: rgba(120, 80, 185, 0.22);
  --adm-primary: #ffc501;
  --adm-primary-hover: #e5b000;
  --adm-accent: #4f2da3;
  --adm-accent-hover: #6339cc;
  --adm-orange: #fb5b23;
  --adm-success: #10b981;
  --adm-danger: #ef4444;
  --adm-warning: #f59e0b;
  --adm-text: #fbfaff;
  --adm-muted: #b8b2cf;
  --adm-font-title: 'Fifties Movies', cursive, sans-serif;
  --adm-font-subtitle: 'Dechorian', sans-serif;
  --adm-font-body: 'Nexa', 'Codec Warm', 'DM Sans', sans-serif;
}

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

body {
  background: var(--adm-bg);
  color: var(--adm-text);
  font-family: var(--adm-font-body);
  font-size: 15px;
  line-height: 1.5;
}

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

.adm-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.adm-sidebar {
  width: 260px;
  background: var(--adm-sidebar);
  border-right: 1px solid var(--adm-border);
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  flex-shrink: 0;
}

.adm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--adm-border);
}

.adm-brand img {
  height: 38px;
}

.adm-brand span {
  font-family: var(--adm-font-title);
  font-weight: normal;
  font-size: 1.25rem;
  letter-spacing: 1px;
}

.adm-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.adm-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--adm-muted);
  font-weight: 500;
  font-size: 0.92rem;
  transition: all 0.2s ease;
}

.adm-nav a i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.adm-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.adm-nav a.active {
  background: var(--adm-primary);
  color: #09090c;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(121, 56, 226, 0.3);
}

.adm-badge {
  margin-left: auto;
  background: var(--adm-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.adm-user-box {
  padding-top: 18px;
  border-top: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.adm-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.adm-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(121, 56, 226, 0.2);
  color: var(--adm-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Main Content */
.adm-main {
  flex-grow: 1;
  padding: 36px 40px;
  overflow-y: auto;
}

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

.adm-title {
  font-family: var(--adm-font-subtitle);
  font-size: 1.7rem;
  font-weight: normal;
  letter-spacing: 0.3px;
  color: #fff;
}

.adm-subtitle {
  color: var(--adm-muted);
  font-size: 0.95rem;
}

/* Metric Cards */
.adm-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.adm-stat-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: 14px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.adm-stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(255, 197, 1, 0.12);
  color: var(--adm-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.adm-stat-val {
  font-family: var(--adm-font-title);
  font-size: 1.8rem;
  font-weight: normal;
  color: #fff;
  line-height: 1;
}

.adm-stat-lbl {
  color: var(--adm-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Card Containers */
.adm-card {
  background: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 30px;
}

.adm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.adm-card-title {
  font-family: var(--adm-font-subtitle);
  font-size: 1.2rem;
  font-weight: normal;
  letter-spacing: 0.3px;
  color: #fff;
}

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

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

.adm-table th {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--adm-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--adm-border);
}

.adm-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--adm-border);
  vertical-align: middle;
}

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

.adm-thumb {
  width: 60px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: #000;
}

/* Buttons */
.adm-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.adm-btn-primary {
  background: var(--adm-primary);
  color: #09090c;
  font-weight: 700;
}

.adm-btn-primary:hover {
  background: var(--adm-primary-hover);
  color: #09090c;
}

.adm-btn-outline {
  background: transparent;
  border: 1px solid var(--adm-border);
  color: var(--adm-text);
}

.adm-btn-outline:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.adm-btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.adm-btn-danger:hover {
  background: #ef4444;
  color: #fff;
}

.adm-btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

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

.adm-form-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 8px;
  color: var(--adm-muted);
}

.adm-input, .adm-select, .adm-textarea {
  width: 100%;
  background: #111118;
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: #fff;
  transition: all 0.2s ease;
}

.adm-input:focus, .adm-select:focus, .adm-textarea:focus {
  outline: none;
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 3px rgba(121, 56, 226, 0.25);
}

.adm-textarea {
  resize: vertical;
  min-height: 110px;
}

/* Pill status */
.pill-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.pill-inactive {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Image upload preview box */
.upload-dropzone {
  border: 2px dashed var(--adm-border);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
  transition: all 0.2s ease;
}

.upload-dropzone:hover {
  border-color: var(--adm-primary);
  background: rgba(121, 56, 226, 0.04);
}

.upload-preview {
  max-width: 220px;
  max-height: 150px;
  border-radius: 8px;
  margin-top: 14px;
  display: none;
  object-fit: cover;
}

/* Modal for dynamic category creation */
.adm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  padding: 16px;
}

.adm-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.adm-modal-box {
  background: var(--adm-card);
  border: 1px solid var(--adm-primary);
  border-radius: 14px;
  width: 100%;
  max-width: 460px;
  padding: 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 197, 1, 0.15);
  transform: translateY(20px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.adm-modal-overlay.active .adm-modal-box {
  transform: translateY(0) scale(1);
}

.btn-open-cat-modal {
  background: rgba(255, 197, 1, 0.15);
  border: 1px solid var(--adm-primary);
  color: var(--adm-primary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn-open-cat-modal:hover {
  background: var(--adm-primary);
  color: #09090c;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(255, 197, 1, 0.4);
}

/* Responsive */
@media (max-width: 900px) {
  .adm-layout { flex-direction: column; }
  .adm-sidebar { width: 100%; }
  .adm-main { padding: 24px 20px; }
}
