/*
   Rupinder Kaur Sandhu - Admin Panel Stylesheet
   Palette: #021a32 (Midnight Navy), #164fa3 (Royal Blue), #f8cf25 (Punjab Saffron Gold)
*/

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --bg-dark: #021a32;
  --bg-surface: #062343;
  --bg-card: rgba(6, 35, 67, 0.8);
  --primary-blue: #164fa3;
  --primary-blue-light: #256bcf;
  --gold-accent: #f8cf25;
  --text-white: #ffffff;
  --text-light: #e2e8f0;
  --text-muted: #94a3b8;
  --border-gold: rgba(248, 207, 37, 0.3);
  --border-blue: rgba(22, 79, 163, 0.4);
  --danger-red: #ef4444;
  --success-green: #22c55e;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 5% 10%, rgba(22, 79, 163, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 95% 90%, rgba(248, 207, 37, 0.08) 0%, transparent 40%);
}

a {
  color: var(--gold-accent);
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-white);
}

.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Login Card Screen */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-card {
  background: var(--bg-card);
  border: 2px solid var(--border-gold);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  max-width: 450px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(248, 207, 37, 0.15);
  backdrop-filter: blur(16px);
  text-align: center;
}

.login-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--gold-accent);
  object-fit: cover;
  margin: 0 auto 1.25rem auto;
  box-shadow: 0 0 20px rgba(248, 207, 37, 0.3);
}

.login-title {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-light);
}

.form-control {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-blue);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  color: var(--text-white);
  font-size: 16px !important;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--gold-accent);
  box-shadow: 0 0 14px rgba(248, 207, 37, 0.3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-accent), #e0b60d);
  color: var(--bg-dark);
  box-shadow: 0 6px 20px rgba(248, 207, 37, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(248, 207, 37, 0.5);
  color: var(--bg-dark);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--danger-red);
  color: #fca5a5;
}

.btn-danger:hover {
  background: var(--danger-red);
  color: #ffffff;
}

.btn-outline {
  background: rgba(22, 79, 163, 0.25);
  border: 1px solid var(--primary-blue-light);
  color: var(--text-white);
}

.btn-outline:hover {
  background: var(--primary-blue);
  color: #ffffff;
}

/* Dashboard Header */
.admin-navbar {
  background: rgba(2, 26, 50, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-gold);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.admin-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold-accent);
  object-fit: cover;
}

.admin-brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-white);
}

.admin-brand-sub {
  font-size: 0.75rem;
  color: var(--gold-accent);
  font-weight: 700;
  text-transform: uppercase;
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-badge {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid var(--success-green);
  color: #4ade80;
  padding: 0.3rem 0.85rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Stats Widgets Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-blue);
  border-left: 4px solid var(--gold-accent);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gold-accent);
  line-height: 1;
}

.stat-lbl {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(248, 207, 37, 0.12);
  color: var(--gold-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* Main Dashboard Section */
.dash-section {
  background: var(--bg-card);
  border: 1px solid var(--border-blue);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2.5rem;
}

.dash-sec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dash-sec-title {
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.dash-sec-title i {
  color: var(--gold-accent);
}

/* Table Styles */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.admin-table th {
  background: rgba(2, 26, 50, 0.6);
  color: var(--gold-accent);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--border-blue);
}

.admin-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgba(22, 79, 163, 0.15);
}

.table-thumb {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border-gold);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.table-thumb:hover {
  transform: scale(1.06);
  border-color: var(--gold-accent);
  box-shadow: 0 0 12px rgba(248, 207, 37, 0.4);
}

.badge-tag {
  display: inline-block;
  background: rgba(22, 79, 163, 0.3);
  color: #60a5fa;
  border: 1px solid var(--border-blue);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.table-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-size: 0.9rem;
}

.btn-edit {
  background: rgba(248, 207, 37, 0.15);
  border: 1px solid var(--gold-accent);
  color: var(--gold-accent);
}

.btn-edit:hover {
  background: var(--gold-accent);
  color: var(--bg-dark);
}

.btn-delete {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger-red);
  color: #f87171;
}

.btn-delete:hover {
  background: var(--danger-red);
  color: #ffffff;
}

/* Category Filter Tabs Bar */
.admin-cat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem;
  background: rgba(2, 26, 50, 0.6);
  border: 1px solid var(--border-blue);
  border-radius: 14px;
}

.admin-cat-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-light);
  padding: 0.55rem 1.15rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-cat-tab:hover {
  background: rgba(22, 79, 163, 0.3);
  color: var(--text-white);
  border-color: var(--border-blue);
}

.admin-cat-tab.active {
  background: linear-gradient(135deg, var(--primary-blue), #216bd9);
  color: var(--text-white);
  border-color: var(--gold-accent);
  box-shadow: 0 4px 15px rgba(22, 79, 163, 0.4);
}

.category-group-row td {
  background: rgba(6, 35, 67, 0.95) !important;
  color: var(--gold-accent) !important;
  font-weight: 800;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1.25rem !important;
  border-top: 2px solid var(--primary-blue);
  border-bottom: 2px solid var(--border-gold);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(2, 26, 50, 0.92);
  backdrop-filter: blur(16px);
  padding: 1.5rem;
  overflow-y: auto;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-surface);
  border: 2px solid var(--border-gold);
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  padding: 2rem;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--gold-accent);
  color: var(--bg-dark);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
}

/* Upload Form Component Classes */
.upload-form-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
  align-items: start;
}

.upload-drop-card {
  border: 2px dashed var(--border-gold);
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
  background: var(--bg-surface);
  cursor: pointer;
  transition: var(--transition);
}

.upload-drop-card:hover {
  border-color: var(--gold-accent);
  background: rgba(248, 207, 37, 0.05);
}

.upload-drop-icon {
  font-size: 2.2rem;
  color: var(--gold-accent);
  margin-bottom: 0.4rem;
}

.upload-drop-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-white);
}

.upload-drop-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.upload-preview-thumb {
  display: none;
  max-height: 140px;
  margin: 0.75rem auto 0 auto;
  border-radius: 10px;
  border: 1px solid var(--border-gold);
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.btn-submit-upload {
  width: 100%;
  min-height: 46px;
}

.dash-main {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

/* Keyframe Animations */
@keyframes slideUpSheet {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive Media Queries for Tablets & Mobile Devices */

/* Large Tablets & Laptops (< 1024px) */
@media (max-width: 1024px) {
  .dash-main {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    margin: 1.75rem 0;
  }

  .upload-form-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Tablets & Mobile Devices (< 768px) */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .admin-navbar {
    padding: 0.75rem 0;
  }

  .admin-brand {
    gap: 0.6rem;
  }

  .admin-logo-img {
    width: 38px;
    height: 38px;
  }

  .admin-brand-title {
    font-size: 1rem;
    line-height: 1.2;
  }

  .admin-brand-sub {
    font-size: 0.68rem;
  }

  .admin-user-info {
    gap: 0.4rem;
  }

  .admin-badge {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
  }

  .nav-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    min-height: 38px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 1.25rem 0;
  }

  .stat-card {
    padding: 0.85rem 1rem;
    border-radius: 14px;
  }

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

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

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    border-radius: 10px;
  }

  .dash-section {
    padding: 1.25rem 1rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
  }

  .dash-sec-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .dash-sec-title {
    font-size: 1.1rem;
  }

  #adminSearchInput {
    min-width: 100% !important;
    width: 100%;
  }

  /* Horizontal Touch Scrollable Category Bar */
  .admin-cat-bar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 0.4rem;
    margin-bottom: 1.25rem;
    gap: 0.4rem;
  }

  .admin-cat-bar::-webkit-scrollbar {
    display: none;
  }

  .admin-cat-tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 0.45rem 0.85rem;
    min-height: 38px;
  }

  .form-row-2col {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Responsive Table Customizations */
  .table-responsive {
    margin: 0 -0.5rem;
    width: calc(100% + 1rem);
  }

  /* Mobile Table Column Hiding (Show only Preview, Category, Actions on mobile) */
  .admin-table .col-title-context,
  .admin-table .col-seo-alt {
    display: none !important;
  }

  .admin-table th, 
  .admin-table td {
    padding: 0.75rem 0.6rem;
    font-size: 0.82rem;
  }

  .admin-table th {
    font-size: 0.78rem;
  }

  .table-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
  }

  .table-actions {
    gap: 0.35rem;
  }

  .btn-icon {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }

  /* Mobile Bottom Sheet Modal */
  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal-content {
    border-radius: 20px 20px 0 0;
    max-height: 88vh;
    padding: 1.5rem 1.25rem;
    margin: 0;
    animation: slideUpSheet 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .modal-close {
    top: 0.85rem;
    right: 0.85rem;
    width: 36px;
    height: 36px;
  }
}

/* Small Smartphone Displays (< 480px) */
@media (max-width: 480px) {
  .admin-brand-title {
    font-size: 0.9rem;
  }

  .badge-text {
    display: none;
  }

  .btn-label {
    display: none;
  }

  .nav-btn {
    padding: 0.4rem 0.6rem;
    border-radius: 50%;
    width: 36px;
    height: 36px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .stat-card {
    padding: 0.75rem;
    border-left-width: 3px;
  }

  .stat-val {
    font-size: 1.2rem;
  }

  .stat-lbl {
    font-size: 0.7rem;
  }

  .stat-icon {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }

  .login-card {
    padding: 1.75rem 1.25rem;
    border-radius: 20px;
  }

  .login-avatar {
    width: 68px;
    height: 68px;
  }

  .login-title {
    font-size: 1.3rem;
  }

  .login-subtitle {
    font-size: 0.82rem;
    margin-bottom: 1.5rem;
  }

  .upload-drop-card {
    padding: 1.15rem 0.85rem;
  }

  .upload-drop-icon {
    font-size: 1.8rem;
  }

  .admin-cat-tab {
    font-size: 0.78rem;
    padding: 0.4rem 0.75rem;
  }
}
