/* ===================================================================
   INK N WIRE - ADMIN PANEL STYLESHEET
   Flat & Boxy Cyber-Industrial Neobrutalism with 3D Frosted Glass
=================================================================== */

:root {
  --bg-main: #07080b;
  --bg-sidebar: #0a0d14;
  --bg-card: rgba(13, 16, 23, 0.85);
  --bg-card-hover: rgba(19, 23, 34, 0.95);
  --bg-input: #06070a;
  
  --teal-primary: #00f5d4;
  --teal-hover: #52ffee;
  --teal-glow: rgba(0, 245, 212, 0.35);
  --teal-subtle: rgba(0, 245, 212, 0.08);
  --teal-border: rgba(0, 245, 212, 0.3);
  
  --border-box: #1a2232;
  --border-subtle: #121824;
  --text-white: #ffffff;
  --text-muted: #8b9bb4;
  --text-secondary: #c2cbd8;
  --danger-color: #ff3366;
  --success-color: #00f5d4;
  --warning-color: #ffaa00;

  --font-heading: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-secondary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}

/* ===================================================================
   LAYOUT & SIDEBAR
=================================================================== */
.admin-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.admin-sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-box);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition-smooth);
}

.sidebar-header {
  padding: 1.75rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

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

.sidebar-title-wrap {
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #ffffff;
}

.sidebar-title span {
  color: var(--teal-primary);
}

.sidebar-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--teal-primary);
  background: var(--teal-subtle);
  border: 1px solid var(--teal-border);
  padding: 0.1rem 0.4rem;
  display: inline-block;
  margin-top: 0.2rem;
  width: fit-content;
}

.sidebar-nav {
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-grow: 1;
}

.nav-category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  padding: 0.75rem 0.75rem 0.25rem 0.75rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.sidebar-link i {
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  width: 20px;
  text-align: center;
}

.sidebar-link:hover {
  background: var(--bg-card);
  color: #ffffff;
  border-color: var(--border-box);
}

.sidebar-link:hover i {
  color: var(--teal-primary);
}

.sidebar-link.active {
  background: rgba(0, 245, 212, 0.08);
  border: 1px solid var(--teal-border);
  color: var(--teal-primary);
  box-shadow: inset 3px 0 0 var(--teal-primary);
}

.sidebar-link.active i {
  color: var(--teal-primary);
}

.sidebar-link .badge-count {
  margin-left: auto;
  background: #151a26;
  border: 1px solid var(--border-box);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  font-family: var(--font-mono);
}

.sidebar-link.active .badge-count {
  background: var(--teal-primary);
  color: #000000;
  border-color: var(--teal-primary);
  font-weight: 700;
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-user-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-box);
  padding: 0.6rem 0.85rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: rgba(0, 245, 212, 0.12);
  border: 1px solid var(--teal-border);
  color: var(--teal-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

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

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
}

.user-status {
  font-size: 0.7rem;
  color: var(--teal-primary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.user-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-primary);
  box-shadow: 0 0 6px var(--teal-glow);
}

/* ===================================================================
   MAIN CONTENT AREA
=================================================================== */
.admin-main {
  margin-left: 280px;
  flex-grow: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top right, rgba(0, 245, 212, 0.03) 0%, transparent 60%);
}

.topbar {
  padding: 1.25rem 2rem;
  background: rgba(10, 13, 20, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-box);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-title-wrap h1 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.page-title-wrap p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-body {
  padding: 2rem;
  flex-grow: 1;
}

/* ===================================================================
   UI BUTTONS & INPUTS
=================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.btn-teal {
  background: var(--teal-primary);
  color: #000000;
  box-shadow: 0 0 15px var(--teal-glow);
}

.btn-teal:hover {
  background: var(--teal-hover);
  box-shadow: 0 0 25px rgba(0, 245, 212, 0.6);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-box);
  color: #ffffff;
}

.btn-outline:hover {
  border-color: var(--teal-primary);
  color: var(--teal-primary);
  background: var(--teal-subtle);
}

.btn-danger {
  background: rgba(255, 51, 102, 0.12);
  border: 1px solid rgba(255, 51, 102, 0.3);
  color: var(--danger-color);
}

.btn-danger:hover {
  background: var(--danger-color);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.4);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
}

.form-control,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-box);
  color: #ffffff;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--teal-primary);
  box-shadow: 0 0 10px var(--teal-glow);
}

.form-select option {
  background: #0d1017;
  color: #ffffff;
}

.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-white);
  letter-spacing: 0.05em;
}

/* ===================================================================
   CARDS & STATS WIDGETS
=================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-box);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: all var(--transition-fast);
}

.stat-card:hover {
  border-color: var(--teal-primary);
  transform: translateY(-2px);
}

.stat-icon-box {
  width: 52px;
  height: 52px;
  background: var(--teal-subtle);
  border: 1px solid var(--teal-border);
  color: var(--teal-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

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

.stat-number {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.admin-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-box);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

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

.admin-card-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-card-title i {
  color: var(--teal-primary);
}

/* ===================================================================
   DATA TABLES
=================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.admin-table th {
  background: #090c13;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-box);
}

.admin-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.88rem;
  vertical-align: middle;
}

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

.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-hq {
  background: rgba(0, 245, 212, 0.1);
  border: 1px solid var(--teal-border);
  color: var(--teal-primary);
}

.badge-studio {
  background: rgba(255, 170, 0, 0.1);
  border: 1px solid rgba(255, 170, 0, 0.3);
  color: var(--warning-color);
}

.table-img-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 1px solid var(--border-box);
  background: #000000;
}

/* ===================================================================
   GALLERY GRID VIEW
=================================================================== */
.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.gallery-admin-card {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-box);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: all var(--transition-fast);
}

.gallery-admin-card:hover {
  border-color: var(--teal-primary);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
  transform: translateY(-2px);
}

.gallery-admin-media {
  height: 220px;
  position: relative;
  overflow: hidden;
  background: #000000;
}

.gallery-admin-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.gallery-admin-card:hover .gallery-admin-media img {
  transform: scale(1.05);
}

.gallery-admin-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}

.gallery-admin-info {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.gallery-admin-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.gallery-admin-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.gallery-admin-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.gallery-admin-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.gallery-admin-actions {
  display: flex;
  gap: 0.4rem;
}

/* ===================================================================
   MODALS
=================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.85);
  backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1.5rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-box);
  width: 100%;
  max-width: 600px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 245, 212, 0.15);
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

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

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ===================================================================
   ALERTS
=================================================================== */
.alert {
  padding: 1rem 1.25rem;
  border: 1px solid transparent;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success {
  background: rgba(0, 245, 212, 0.08);
  border-color: var(--teal-border);
  color: var(--teal-primary);
}

.alert-danger {
  background: rgba(255, 51, 102, 0.08);
  border-color: rgba(255, 51, 102, 0.3);
  color: var(--danger-color);
}

/* ===================================================================
   MOBILE BOTTOM NAVIGATION BAR
=================================================================== */
.admin-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 66px;
  background: rgba(7, 9, 14, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--teal-border);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 245, 212, 0.12);
  z-index: 1000;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0);
  align-items: center;
  justify-content: space-around;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.3px;
  flex: 1;
  height: 100%;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav-icon {
  font-size: 1.15rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.bottom-nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--teal-primary);
  color: #000000;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 4px;
  line-height: 1.2;
  font-family: var(--font-mono);
  box-shadow: 0 0 8px var(--teal-primary);
}

.bottom-nav-dot {
  position: absolute;
  top: -2px;
  right: -5px;
  width: 7px;
  height: 7px;
  background: var(--teal-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--teal-primary);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.bottom-nav-item:hover,
.bottom-nav-item:focus {
  color: #ffffff;
}

.bottom-nav-item.active {
  color: var(--teal-primary);
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 3px;
  background: var(--teal-primary);
  box-shadow: 0 0 10px var(--teal-primary), 0 0 20px var(--teal-primary);
}

.bottom-nav-item.active .bottom-nav-icon {
  transform: translateY(-2px);
  color: var(--teal-primary);
  text-shadow: 0 0 12px var(--teal-glow);
}

/* ===================================================================
   RESPONSIVE LAYOUT & MOBILE OPTIMIZATIONS
=================================================================== */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    display: none; /* Hidden on mobile; replaced by bottom navigation */
  }

  .admin-bottom-nav {
    display: flex;
  }

  .admin-main {
    margin-left: 0;
    width: 100%;
    min-height: 100vh;
    padding-bottom: 85px; /* Prevent bottom nav overlap */
  }

  .topbar {
    padding: 1.1rem 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .page-title-wrap h1 {
    font-size: 1.35rem;
  }

  .page-title-wrap p {
    font-size: 0.8rem;
  }

  .topbar-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }

  .topbar-actions .btn {
    flex: 1;
    justify-content: center;
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
  }

  .admin-body {
    padding: 1rem 0.85rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
    gap: 0.75rem;
  }

  .stat-icon-box {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }

  .stat-number {
    font-size: 1.4rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .gallery-admin-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .gallery-admin-media {
    height: 220px;
  }

  .admin-card {
    padding: 1.1rem;
    margin-bottom: 1.25rem;
  }

  .admin-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .table-responsive {
    border: 1px solid var(--border-box);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-table th, 
  .admin-table td {
    padding: 0.75rem 0.65rem;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .modal-backdrop {
    padding: 0.75rem;
    align-items: flex-end;
  }

  .modal-card {
    max-width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.9);
  }

  .modal-header {
    padding: 1rem 1.25rem;
  }

  .modal-body {
    padding: 1.1rem 1.25rem;
  }

  .modal-footer {
    padding: 1rem 1.25rem;
    flex-direction: column-reverse;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
