/* assets/css/admin.css - TRIKOT MANIA 27 Admin Panel Styling */
:root {
  --admin-bg: #040914;
  --admin-sidebar: #061124;
  --admin-card: #091933;
  --admin-border: rgba(212, 175, 55, 0.25);
  --gold: #d4af37;
  --gold-light: #fef08a;
  --gold-border: rgba(212, 175, 55, 0.4);
  --gold-grad: linear-gradient(135deg, #d4af37 0%, #fef08a 50%, #b45309 100%);
  --text-white: #ffffff;
  --text-muted: #94a3b8;
  --danger: #ef4444;
  --success: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
  background-color: var(--admin-bg);
  color: #e2e8f0;
  min-height: 100vh;
  display: flex;
}

/* TOPBAR & MOBILE CONTROLS (Hidden by default on Desktop) */
.admin-topbar {
  display: none;
}
.admin-sidebar-close {
  display: none;
}
.admin-sidebar-backdrop {
  display: none;
}
.admin-header-menu-btn {
  display: none;
}

/* ADMIN SIDEBAR (DESKTOP) */
.admin-sidebar {
  width: 260px;
  background-color: var(--admin-sidebar);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 100vh;
}
.admin-sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.admin-nav {
  list-style: none;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.2s;
}
.admin-nav-item a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-white);
}
.admin-nav-item a.active {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
  border: 1px solid var(--gold-border);
}

/* ADMIN MAIN CONTENT AREA */
.admin-main {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  max-width: 1400px;
  min-width: 0;
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 16px;
}
.admin-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-white);
}

/* CARDS & TABLES */
.admin-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}
.stat-box {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.stat-val {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold-light);
  margin-top: 4px;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
  min-width: 600px;
}
.admin-table th {
  background: rgba(4, 9, 20, 0.7);
  padding: 12px 14px;
  color: var(--gold-light);
  font-weight: 700;
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}
.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* FORMS & INPUTS */
.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.admin-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-light);
}
.admin-input, .admin-select, .admin-textarea {
  background: #040914;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text-white);
  font-size: 0.9rem;
  outline: none;
  width: 100%;
}
.admin-input:focus, .admin-select:focus, .admin-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
}
.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.btn-admin {
  background: var(--gold-grad);
  color: #040914;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-admin:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}
.btn-admin-danger {
  background: var(--danger);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

/* DRAG & DROP UPLOAD ZONE */
.dropzone {
  border: 2px dashed var(--gold);
  border-radius: 10px;
  padding: 32px 20px;
  text-align: center;
  background: rgba(4, 9, 20, 0.5);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
}
.dropzone:hover, .dropzone.dragover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--gold-light);
}
.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  color: var(--gold);
}
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.preview-item {
  position: relative;
  background: #040914;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: 6px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.preview-item img {
  max-width: 100%;
  max-height: 80%;
  object-fit: contain;
}
.cover-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: var(--gold-grad);
  color: #040914;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
}

/* LOGIN BOX */
.login-wrap {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--admin-bg);
  padding: 16px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 36px 32px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

/* ========================================================= */
/* RESPONSIVE MOBILE ADMIN STYLING (< 900px / SMARTPHONES)  */
/* ========================================================= */
@media (max-width: 900px) {
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
  }
  body.admin-sidebar-open {
    overflow: hidden;
  }

  /* STICKY TOPBAR */
  .admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #061124;
    border-bottom: 1px solid var(--admin-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  }
  .admin-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--gold);
    color: var(--gold-light);
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
  }
  .admin-hamburger-icon {
    font-size: 1.15rem;
    line-height: 1;
  }
  .admin-topbar-brand {
    display: flex;
    align-items: center;
  }
  .admin-topbar-logout {
    font-size: 1.25rem;
    text-decoration: none;
    padding: 6px 10px;
    color: #fca5a5;
  }

  /* HEADER MENU BUTTON */
  .admin-header-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    color: var(--gold-light);
    font-size: 1.25rem;
    cursor: pointer;
    flex-shrink: 0;
  }

  /* OFF-CANVAS SLIDE-IN SIDEBAR */
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 85vw;
    height: 100vh;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.85);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #ffffff;
    font-size: 1.1rem;
    cursor: pointer;
  }

  /* BACKDROP */
  .admin-sidebar-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(3px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
  }
  .admin-sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* 100% FULL-WIDTH MAIN CONTENT ON MOBILE */
  .admin-main {
    flex: 1;
    padding: 16px 12px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 12px;
  }
  .admin-title {
    font-size: 1.35rem;
  }
  .admin-user-info {
    font-size: 0.78rem;
  }

  /* FORMS & GRIDS SINGLE COLUMN ON MOBILE */
  .admin-grid-2,
  div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .admin-card {
    padding: 16px 12px;
    margin-bottom: 16px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .admin-input, .admin-select, .admin-textarea {
    font-size: 16px !important; /* Prevents auto-zoom in mobile Safari */
    width: 100%;
  }
  .btn-admin {
    width: 100%;
    justify-content: center;
    padding: 12px 18px;
    font-size: 0.95rem;
  }
  .image-preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
