/* =========================================
   admin.css — Koshatakin Exim Admin Panel
========================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Jost:wght@300;400;500;600&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  --cream: #FDF9F5;
  --dark-brown: #4A2E2A;
  --gold: #C8A96A;
  --gold-hover: #C19A6B;
  --text: #1A1A1A;
  --text-muted: #7D6F6C;
  --white: #FFFFFF;
  --border: #E8E0DA;
  --shadow-sm: 0 4px 12px rgba(74,46,42,0.06);
  --shadow-md: 0 8px 24px rgba(74,46,42,0.08);
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Jost', 'Inter', sans-serif;
  --font-num: 'Space Grotesk', monospace;
  --radius: 8px;
  --sidebar-w: 260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); background: var(--cream); color: var(--text); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
.stat-card .val, .order-id, td:nth-child(n+3), .tbl-img+div+span, .admin-item p { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* Admin Login */
.auth-wrapper { 
  height: 100vh; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  background-color: var(--dark-brown);
  background-image: url('../img/admin_login_bg.png');
  background-repeat: repeat;
  background-size: 450px;
  position: relative; 
}
.auth-overlay { 
  display: block; 
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(42, 26, 24, 0.5); /* Semi-transparent dark overlay for legibility */
  z-index: 1;
}
.auth-box { position: relative; z-index: 2; background: var(--white); width: 100%; max-width: 420px; padding: 3rem 2.5rem; border-radius: 12px; box-shadow: var(--shadow-md); }
.auth-logo { font-family: var(--font-serif); font-size: 2.2rem; font-weight: 700; color: var(--dark-brown); text-align: center; margin-bottom: 0.5rem; }
.auth-logo span { color: var(--gold); }
.auth-box p { text-align: center; color: var(--text-muted); margin-bottom: 2rem; font-size: 0.9rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 500; margin-bottom: 0.4rem; color: var(--dark-brown); }
.form-group input { width: 100%; padding: 0.8rem 1rem; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; outline: none; transition: 0.2s; }
.form-group input:focus { border-color: var(--gold); }
.btn-primary { width: 100%; padding: 0.9rem; background: var(--dark-brown); color: var(--white); font-weight: 500; border-radius: var(--radius); transition: 0.2s; font-size: 0.9rem; letter-spacing: 0.05em; text-transform: uppercase; }
.btn-primary:hover { background: var(--gold-hover); }

/* Layout */
.admin-layout { display: flex; height: 100vh; overflow: hidden; background: #FDF9F5; }
.admin-sidebar { width: var(--sidebar-w); background: var(--white); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; position: relative; z-index: 10; box-shadow: 4px 0 24px rgba(74,46,42,0.04); transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.admin-sidebar.dark-luxury { background: linear-gradient(170deg, #37211E 0%, #1A0F0E 100%); border-right: none; box-shadow: 6px 0 30px rgba(26,15,14,0.4); }
.admin-sidebar.dark-luxury .sidebar-header { border-bottom: 1px solid rgba(200,169,106,0.15); }
.admin-sidebar.dark-luxury .sidebar-footer { border-top: 1px solid rgba(200,169,106,0.15); }
.text-gold { color: var(--gold) !important; text-shadow: 0 2px 10px rgba(200,169,106,0.2); }
.text-white { color: var(--white) !important; }
.sidebar-header { padding: 1.5rem; border-bottom: 1px solid var(--border); }
.sidebar-logo { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700; color: var(--dark-brown); }
.sidebar-logo span { color: var(--gold); }
.sidebar-nav { padding: 1.5rem 1rem; flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }
.nav-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 1rem; font-size: 0.9rem; color: var(--text-muted); border-radius: var(--radius); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border-left: 3px solid transparent; overflow: hidden; position: relative; }
.admin-sidebar.dark-luxury .nav-link { color: rgba(255,255,255,0.7); }
.nav-link:hover { background: var(--cream); color: var(--dark-brown); transform: translateX(4px); }
.admin-sidebar.dark-luxury .nav-link:hover { background: rgba(200,169,106,0.1); color: var(--gold); text-shadow: 0 0 8px rgba(200,169,106,0.2); }
.nav-link.active { background: linear-gradient(90deg, rgba(200,169,106,0.15) 0%, rgba(253,249,245,0) 100%); color: var(--dark-brown); font-weight: 600; border-left: 3px solid var(--dark-brown); }
.admin-sidebar.dark-luxury .nav-link.active { background: linear-gradient(90deg, rgba(200,169,106,0.2) 0%, rgba(255,255,255,0) 100%); color: var(--gold); border-left: 3px solid var(--gold); box-shadow: inset 0 0 20px rgba(200,169,106,0.05); }
.nav-link i { width: 20px; text-align: center; color: var(--gold); transition: color 0.3s; }
.nav-link.active i { color: var(--dark-brown); }
.admin-sidebar.dark-luxury .nav-link.active i { color: var(--gold); text-shadow: 0 0 10px rgba(200,169,106,0.4); }
.admin-sidebar.dark-luxury .logout-btn { color: #e53e3e !important; }
.admin-sidebar.dark-luxury .logout-btn:hover { background: rgba(229,62,62,0.1); color: #ff6b6b !important; }
.sidebar-footer { padding: 1.5rem 1rem; border-top: 1px solid var(--border); }

.admin-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #FDF9F5 /* cream */; }
.admin-header { height: 70px; background: rgba(253, 249, 245, 0.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid rgba(200, 169, 106, 0.3); display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; flex-shrink: 0; position: relative; z-index: 5; box-shadow: 0 4px 20px rgba(74,46,42,0.05); }
.admin-content { flex: 1; overflow-y: auto; padding: 2.5rem; scroll-behavior: smooth; }

/* Dashboard */
.page-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.page-title h1 { font-family: var(--font-serif); font-size: 1.8rem; color: var(--dark-brown); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 2.5rem; }
.stat-card { background: var(--white); padding: 1.5rem; border-radius: 12px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: all 0.3s ease; position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--dark-brown), var(--gold)); opacity: 0; transition: opacity 0.3s ease; }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stat-card:hover::after { opacity: 1; }
.stat-card h3 { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; font-weight: 500; }
.stat-card .val { font-family: var(--font-serif); font-size: 2.2rem; font-weight: 700; color: var(--dark-brown); line-height: 1; }

/* Tables */
.card { background: var(--white); border-radius: 12px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: hidden; transition: box-shadow 0.3s ease; }
.card:hover { box-shadow: var(--shadow-md); }
.card-header { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: rgba(253,249,245,0.5); }
.card-header h2 { font-size: 1.1rem; color: var(--dark-brown); font-weight: 600; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 1rem 1.5rem; text-align: left; font-size: 0.9rem; }
.table th { font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; border-bottom: 2px solid var(--border); background: #faf8f5; }
.table td { border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #faf8f5; }

/* Badges & Utilities */
.badge { padding: 0.25rem 0.6rem; border-radius: 50px; font-size: 0.75rem; font-weight: 500; }
.badge.success { background: #d1fae5; color: #065f46; }
.badge.warning { background: #fef3c7; color: #92400e; }
.badge.neutral { background: var(--cream); color: var(--text-muted); }
.tbl-img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.prod-cell { display: flex; align-items: center; gap: 1rem; }
.prod-cell strong { color: var(--dark-brown); display: block; font-weight: 500; }

.btn-sm { padding: 0.4rem 0.8rem; background: var(--cream); border: 1px solid var(--border); border-radius: 6px; font-size: 0.8rem; color: var(--dark-brown); transition: all 0.2s ease; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; }
.btn-sm:hover { background: var(--dark-brown); border-color: var(--dark-brown); color: var(--white); }

/* Table Action Group & Buttons */
.tbl-action-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.btn-sm.btn-view { color: var(--gold); border-color: rgba(200, 169, 106, 0.4); }
.btn-sm.btn-view:hover { background: var(--gold); border-color: var(--gold); color: #fff; }

.btn-sm.btn-edit { color: var(--dark-brown); border-color: rgba(74, 46, 42, 0.4); }
.btn-sm.btn-edit:hover { background: var(--dark-brown); border-color: var(--dark-brown); color: #fff; }

.btn-sm.btn-delete { color: #e53e3e; border-color: #fca5a5; }
.btn-sm.btn-delete:hover { background: #e53e3e; border-color: #e53e3e; color: #fff; }

.btn-sm.btn-cart { color: var(--gold); border-color: var(--gold); }
.btn-sm.btn-cart:hover { background: var(--gold); color: #fff; }

.btn-sm.btn-wishlist { color: #e53e3e; border-color: #e53e3e; }
.btn-sm.btn-wishlist:hover { background: #e53e3e; color: #fff; }

.btn-gold { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-hover) 100%); color: var(--white); padding: 0.5rem 1rem; border-radius: 6px; border: none; font-size: 0.85rem; font-weight: 500; transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 0.5rem; box-shadow: 0 2px 8px rgba(200,169,106,0.3); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(200,169,106,0.4); }

.detail-row { display: none; background: #faf8f5; }
.detail-row.open { display: table-row; }
.detail-content { padding: 1.5rem; display: flex; gap: 2rem; }
.detail-box { flex: 1; background: var(--white); padding: 1rem; border-radius: 8px; border: 1px solid var(--border); }
.detail-box h4 { font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.admin-item { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; padding-bottom: 0.75rem; border-bottom: 1px dashed var(--border); }
.admin-item:last-child { margin: 0; border: 0; padding: 0; }
.admin-item img { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; }
.admin-item p { font-size: 0.85rem; line-height: 1.3; margin: 0; }
/* Global Aesthetic Loader */
.global-loader-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(42, 22, 19, 0.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  backdrop-filter: blur(8px);
}

.global-loader-overlay.active {
  opacity: 1;
  visibility: visible;
}

.spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(200, 169, 106, 0.1);
  border-top-color: var(--gold);
  border-bottom-color: var(--gold);
  animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

/* Luxurious reveal effects */
.luxury-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  animation: luxuriousReveal 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.luxury-stagger > *:nth-child(1) { animation-delay: 0.1s; }
.luxury-stagger > *:nth-child(2) { animation-delay: 0.2s; }
.luxury-stagger > *:nth-child(3) { animation-delay: 0.3s; }
.luxury-stagger > *:nth-child(4) { animation-delay: 0.4s; }

@keyframes luxuriousReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* Luxury Ripple */
.luxury-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(200, 169, 106, 0.4);
  transform: scale(0);
  animation: luxuriousRipple 0.6s linear;
  pointer-events: none;
  width: 100px;
  height: 100px;
  margin-top: -50px;
  margin-left: -50px;
}

@keyframes luxuriousRipple {
  to { transform: scale(4); opacity: 0; }
}

/* Luxury Ripple */
.luxury-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(200, 169, 106, 0.4);
  transform: scale(0);
  animation: luxuriousRipple 0.6s linear;
  pointer-events: none;
  width: 100px;
  height: 100px;
  margin-top: -50px;
  margin-left: -50px;
}

@keyframes luxuriousRipple {
  to { transform: scale(4); opacity: 0; }
}

/* Fix for SweetAlert Modal Close Button */
.swal2-close {
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 2rem !important;
  color: #4A2E2A !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  width: 40px !important;
  height: 40px !important;
}
.swal2-close:hover {
  color: #e53e3e !important;
  transform: scale(1.1);
}

/* Category module */
.category-page-title {
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.category-page-title h1 {
  font-size: 1.8rem;
  font-weight: 600;
  font-family: var(--font-serif);
  color: var(--dark-brown);
}

.category-add-btn {
  padding: 0.6rem 1.2rem;
}

.category-form-card {
  margin-bottom: 2rem;
}

.category-form-container {
  padding: 1.5rem;
}

.category-form-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--dark-brown);
}

.required-mark {
  color: #e53e3e;
}

.form-input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
  transition: 0.2s;
  font-family: var(--font-sans);
  color: var(--text);
  background: #fff;
}

.form-input:focus {
  border-color: var(--gold);
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--dark-brown);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-grid-two-col {
  grid-template-columns: repeat(2, 1fr);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.action-btn-group {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.btn-outline {
  padding: 0.9rem 1.5rem;
  background: var(--cream);
  border: 1px solid var(--border);
  color: var(--dark-brown);
  font-weight: 500;
  border-radius: var(--radius);
  transition: 0.2s;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.btn-outline:hover {
  background: var(--border);
}

.btn-submit {
  padding: 0.9rem 1.5rem;
  background: linear-gradient(135deg, var(--dark-brown) 0%, #2A1A18 100%);
  color: var(--white);
  border: none;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.3s ease;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(74,46,42,0.2);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(74,46,42,0.3);
}

.is-invalid {
  border-color: #e53e3e !important;
}

.category-table {
  width: 100%;
}

.category-table.dataTable thead th,
.category-table.dataTable tbody td {
  padding: 0.95rem 1rem;
}

.dataTables_wrapper {
  padding: 1.2rem 1.4rem;
}

.dataTables_filter,
.dataTables_length {
  margin-bottom: 0.8rem;
}

.dataTables_filter input {
  border: 1px solid var(--border);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  outline: none;
}

.dataTables_length select {
  border: 1px solid var(--border);
  padding: 0.4rem;
  border-radius: var(--radius);
}

.dataTables_info,
.dataTables_paginate {
  font-size: 0.85rem;
  padding-top: 1rem;
  color: var(--text-muted);
}

.paginate_button {
  margin: 0 0.25rem;
  padding: 0.4rem 0.8rem !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
  background: var(--white) !important;
}

.paginate_button.current {
  background: var(--cream) !important;
  color: var(--dark-brown) !important;
  font-weight: 600;
}
