/* ==========================================================================
   Admin Dashboard Premium Stylesheet
   ========================================================================== */

/* Dashboard & Page Container Background overrides */
#dashboard-container {
  background-color: #0b0f19 !important;
  color: #f8fafc !important;
  min-height: 100vh;
  padding-top: 140px;
  padding-bottom: 4rem;
}

/* 1. Admin Login Panel */
.admin-login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  background-color: #0b0f19;
  padding: 2rem;
}

.admin-login-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
}

.admin-login-card .logo-icon {
  margin: 0 auto 1.5rem auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
  background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-yellow) 100%) !important;
  box-shadow: 0 4px 15px rgba(94, 23, 235, 0.4);
}

.admin-login-card h2 {
  color: #ffffff;
  font-family: var(--font-heading), sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.admin-login-card p {
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 2rem;
}

.admin-login-card label {
  display: block;
  color: #e2e8f0;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
  text-align: left;
}

.admin-login-card input[type="password"] {
  width: 100%;
  padding: 0.85rem 1rem;
  background-color: #1f2937;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  transition: all 0.25s ease;
  margin-bottom: 1.5rem;
}

.admin-login-card input[type="password"]:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(94, 23, 235, 0.25);
}

/* 2. Admin Grid Layout */
.admin-dashboard-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 992px) {
  .admin-dashboard-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* 3. Control Panel Sidebar */
.admin-sidebar {
  background-color: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: calc(100vh - 220px);
  position: sticky;
  top: 160px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

@media (max-width: 992px) {
  .admin-sidebar {
    min-height: auto;
    position: static;
  }
}

.admin-sidebar h3 {
  color: #fff;
  font-family: var(--font-heading), sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent-red);
}

.admin-menu-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #94a3b8;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-tab-btn i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.admin-tab-btn:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: #fff;
}

.admin-tab-btn.active {
  background-color: var(--accent-red);
  color: #fff;
  box-shadow: 0 4px 12px rgba(94, 23, 235, 0.25);
}

.admin-sidebar-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* 4. Main Dashboard Area */
.admin-main-content {
  background-color: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 2rem;
  min-height: calc(100vh - 220px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

@media (max-width: 576px) {
  .admin-main-content {
    padding: 1.25rem;
  }
}

/* 5. Live Stats Panel Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.admin-stat-card {
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
  cursor: pointer;
}

.admin-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.3), 0 4px 6px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.15);
}

.admin-stat-card .stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

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

.admin-stat-card .stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: 0.75px;
}

.admin-stat-card .stat-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  font-family: var(--font-heading), sans-serif;
  margin-top: 0.1rem;
}

/* 6. Section Header and Search Toolbar */
.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-section-title {
  color: #fff;
  font-family: var(--font-heading), sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
  background: linear-gradient(135deg, #fff 60%, var(--accent-red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-toolbar .search-box {
  position: relative;
  max-width: 380px;
  width: 100%;
}

.admin-toolbar .search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.admin-toolbar .search-box input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.25rem;
  background-color: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.admin-toolbar .search-box input:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 2px rgba(94, 23, 235, 0.15);
}

/* 7. Modern Data Tables styling */
.admin-table-wrapper {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background-color: #0b0f19;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.admin-table th {
  background-color: #1f2937;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.75px;
  padding: 1.1rem 1.25rem;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.08);
}

.admin-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  vertical-align: middle;
  font-size: 0.85rem;
  line-height: 1.4;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

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

/* Product Info Cell */
.admin-table-product-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-table-img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: #1f2937;
  flex-shrink: 0;
}

.admin-table-product-info strong {
  color: #fff;
  font-size: 0.9rem;
  display: block;
}

.admin-table-product-info p {
  margin: 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

/* Actions Cell */
.admin-actions-cell {
  display: flex;
  gap: 0.5rem;
}

.btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-mini-edit {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--accent-yellow);
}

.btn-mini-edit:hover {
  background-color: var(--accent-yellow);
  color: #000;
  transform: translateY(-1px);
}

.btn-mini-delete {
  background-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.btn-mini-delete:hover {
  background-color: #ef4444;
  color: #fff;
  transform: translateY(-1px);
}

/* Order list helper */
.order-items-list-admin {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.order-items-list-admin li {
  margin-bottom: 0.3rem;
}

.order-items-list-admin strong {
  color: var(--accent-yellow);
}

/* 8. Color Coded Select Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pending {
  background-color: rgba(245, 158, 11, 0.15) !important;
  color: var(--accent-yellow) !important;
}

.status-confirmed {
  background-color: rgba(59, 130, 246, 0.15) !important;
  color: #3b82f6 !important;
}

.status-completed {
  background-color: rgba(34, 197, 94, 0.15) !important;
  color: #22c55e !important;
}

.status-cancelled {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
}

.status-paid {
  background-color: rgba(34, 197, 94, 0.15) !important;
  color: #22c55e !important;
}

/* Custom interactive select badge overrides */
select.status-badge {
  appearance: none !important;
  -webkit-appearance: none !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  padding-right: 28px !important;
  border: 1px solid transparent !important;
  outline: none;
  font-family: inherit;
}

select.status-badge.status-pending {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23f59e0b' height='12' viewBox='0 0 24 24' width='12' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") !important;
}

select.status-badge.status-confirmed {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%233b82f6' height='12' viewBox='0 0 24 24' width='12' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") !important;
}

select.status-badge.status-completed {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%2322c55e' height='12' viewBox='0 0 24 24' width='12' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") !important;
}

select.status-badge.status-paid {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%2322c55e' height='12' viewBox='0 0 24 24' width='12' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") !important;
}

select.status-badge.status-cancelled {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23ef4444' height='12' viewBox='0 0 24 24' width='12' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") !important;
}

select.status-badge option {
  background-color: #111827;
  color: #ffffff;
}

/* 9. Product Form Modal Overrides */
#product-modal .modal-content {
  background-color: #111827 !important;
  border-top: 5px solid var(--accent-red) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px;
}

#product-modal .modal-header {
  background-color: #0b0f19 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 1.25rem 1.5rem;
}

#product-modal .modal-header h3 {
  font-family: var(--font-heading), sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 1.25rem;
}

#product-modal .modal-body {
  padding: 1.5rem;
}

#product-modal label {
  color: #cbd5e1 !important;
  font-weight: 700 !important;
  font-size: 0.78rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  display: block;
  margin-bottom: 0.45rem;
}

#product-modal input[type="text"],
#product-modal input[type="number"],
#product-modal select,
#product-modal textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

#product-modal input:focus,
#product-modal select:focus,
#product-modal textarea:focus {
  outline: none;
  border-color: var(--accent-red) !important;
  box-shadow: 0 0 0 3px rgba(94, 23, 235, 0.25) !important;
}

#product-modal .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

#product-modal .form-group {
  margin-bottom: 1.25rem;
}

@media (max-width: 576px) {
  #product-modal .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* ==========================================================================
   Admin Portal Enhancements (Image Upload & Category Manager)
   ========================================================================== */

/* 1. Upload Button & Preview */
.upload-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.upload-group input[type="text"] {
  flex: 1;
}

.btn-upload-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: transparent;
  color: var(--accent-yellow) !important;
  border: 1.5px solid var(--accent-yellow) !important;
  padding: 0.75rem 1.25rem !important;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  height: auto;
  box-sizing: border-box;
  white-space: nowrap;
}

.btn-upload-trigger:hover {
  background-color: var(--accent-yellow) !important;
  color: #000 !important;
  transform: translateY(-1px);
}

.image-preview-wrapper {
  margin-top: 0.75rem;
  background-color: #0b0f19;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.image-preview-wrapper img {
  max-height: 80px;
  max-width: 120px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.image-preview-info {
  font-size: 0.75rem;
  color: #94a3b8;
}

.image-preview-info strong {
  color: #fff;
  display: block;
  margin-bottom: 0.15rem;
}

/* 2. Dynamic Category Management Styles */
.category-form-inline {
  background-color: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.category-form-inline h4 {
  color: #fff;
  font-family: var(--font-heading), sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.5rem;
}

.category-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1.25rem;
  align-items: end;
}

@media (max-width: 768px) {
  .category-form-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.category-form-grid .form-group {
  margin: 0;
}

.category-form-grid input {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: #111827;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.category-form-grid input:focus {
  outline: none;
  border-color: var(--accent-red) !important;
  box-shadow: 0 0 0 3px rgba(94, 23, 235, 0.25) !important;
}

/* ==========================================================================
   Advanced Mobile Responsiveness Media Queries
   ========================================================================== */

@media (max-width: 992px) {
  .admin-sidebar {
    min-height: auto;
    position: static;
    padding: 1.25rem;
  }
}

@media (max-width: 768px) {
  .admin-sidebar h3 {
    display: none; /* Hide Control Panel title to save space */
  }
  .admin-menu-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  .admin-tab-btn {
    width: auto;
    flex: 1 1 calc(50% - 0.5rem); /* two buttons per row */
    min-width: 140px;
    padding: 0.65rem 0.85rem;
    font-size: 0.75rem;
    justify-content: center;
  }
  .admin-sidebar-footer {
    margin-top: 1rem;
    padding-top: 1rem;
  }
}

@media (max-width: 576px) {
  .admin-section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    text-align: center;
  }
  .admin-section-header .btn {
    width: 100%;
  }
  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    text-align: center;
  }
  .admin-toolbar .search-box {
    width: 100%;
  }
  
  #product-modal .form-row {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 0;
  }
  #product-modal .form-group {
    margin-bottom: 1.25rem;
  }
  #product-modal .modal-content {
    margin: 1rem;
    max-height: calc(100vh - 2rem);
  }
  
  .upload-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .btn-upload-trigger {
    width: 100%;
    padding: 0.65rem 1rem !important;
  }
}

@media (max-width: 480px) {
  .admin-login-wrapper {
    padding: 1rem;
  }
  .admin-login-card {
    padding: 2rem 1.5rem;
  }
  .admin-login-card h2 {
    font-size: 1.5rem;
  }
  
  .admin-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  .admin-stat-card {
    padding: 0.85rem;
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  .admin-stat-card .stat-icon {
    margin: 0;
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
  .stat-info .stat-label {
    font-size: 0.65rem;
  }
  .stat-info .stat-value {
    font-size: 1.05rem;
  }
  
  .admin-tab-btn {
    flex: 1 1 100%; /* stack navigation items full-width on tiny screens */
  }
}

/* Tab View Animations & Micro-interactions */
.tab-view {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* Button & Tab Hover Glowing Accents */
.admin-tab-btn {
  position: relative;
  overflow: hidden;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.admin-tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--accent-yellow);
  transition: width 0.25s ease, left 0.25s ease;
}

.admin-tab-btn:hover::after {
  width: 80%;
  left: 10%;
}

.admin-tab-btn.active {
  box-shadow: 0 4px 14px rgba(94, 23, 235, 0.45);
}

.btn-mini {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn-mini:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.btn-mini:active {
  transform: translateY(0);
}
