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

:root {
  --maroon-deep: #40101B;
  --maroon: #671D2D;
  --maroon-light: #8B2C42;
  --gold: #D99A2B;
  --gold-light: #F3C363;
  --gold-glow: #FFD580;
  --saffron: #E97535;
  --saffron-deep: #C75518;
  --cream: #FFF8EB;
  --cream-light: #FFFDF8;
  --cream-card: #FFFFFF;
  --cream-border: #ECD8BD;
  --text-primary: #2C211D;
  --text-muted: #7E6C65;
  --text-light: #FFF8EB;
  --success: #2E7D32;
  --danger: #C62828;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-soft: 0 4px 20px rgba(103, 29, 45, 0.08);
  --shadow-hover: 0 8px 30px rgba(103, 29, 45, 0.16);
  --shadow-gold: 0 4px 20px rgba(217, 154, 43, 0.25);
}

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

body {
  font-family: 'Outfit', 'Noto Sans Tamil', -apple-system, sans-serif;
  background-color: #FBF7F2;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Top Bar */
.admin-navbar {
  background: linear-gradient(135deg, var(--maroon-deep), var(--maroon));
  color: var(--text-light);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-badge {
  width: 44px;
  height: 44px;
  background: radial-gradient(circle, var(--gold-light), var(--gold));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-gold);
}

.brand-title h1 {
  font-family: 'Noto Sans Tamil', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--gold-light);
  letter-spacing: 0.5px;
}

.brand-title p {
  font-size: 11px;
  color: rgba(255, 248, 235, 0.75);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(46, 125, 50, 0.2);
  border: 1px solid rgba(46, 125, 50, 0.4);
  color: #81C784;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-indicator {
  width: 8px;
  height: 8px;
  background-color: #81C784;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

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

.btn-logout {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(243, 195, 99, 0.4);
  color: var(--gold-light);
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-logout:hover {
  background: var(--maroon-light);
  color: #fff;
  border-color: var(--gold);
}

/* Layout container */
.admin-container {
  display: flex;
  flex: 1;
}

/* Sidebar */
.admin-sidebar {
  width: 250px;
  background: #FFFFFF;
  border-right: 1px solid var(--cream-border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-link svg, .nav-link i {
  font-size: 18px;
  color: var(--maroon);
}

.nav-link:hover {
  background: var(--cream);
  color: var(--maroon);
  transform: translateX(3px);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--maroon), var(--maroon-light));
  color: var(--gold-light);
  border-color: var(--gold);
  box-shadow: 0 4px 12px rgba(103, 29, 45, 0.2);
}

.nav-link.active svg, .nav-link.active i {
  color: var(--gold-light);
}

/* Main Content Area */
.admin-main {
  flex: 1;
  padding: 28px 36px;
  overflow-y: auto;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--maroon);
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--maroon), var(--maroon-light));
  color: var(--gold-light);
  border: 1px solid var(--gold);
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-soft);
  transition: all 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  background: var(--maroon-deep);
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: #FFFFFF;
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--gold);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gold);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.stat-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  color: var(--maroon);
  font-size: 18px;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--maroon);
}

/* Grid & Content Cards */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card-item {
  background: #FFFFFF;
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.card-item:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--gold);
  transform: translateY(-3px);
}

.card-thumb {
  height: 140px;
  width: 100%;
  object-fit: cover;
  background-color: var(--maroon);
}

.card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-category-badge {
  align-self: flex-start;
  background: var(--cream);
  border: 1px solid var(--cream-border);
  color: var(--saffron-deep);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--maroon);
  margin-bottom: 6px;
}

.card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #F5ECE3;
  padding-top: 12px;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--cream);
  color: var(--maroon);
}

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

/* Tables */
.table-container {
  background: #FFFFFF;
  border: 1px solid var(--cream-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: var(--cream);
  color: var(--maroon);
  font-weight: 700;
  padding: 14px 18px;
  border-bottom: 1px solid var(--cream-border);
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #F6EFE9;
  vertical-align: middle;
}

.data-table tr:hover {
  background-color: var(--cream-light);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

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

.modal-content {
  background: #FFFFFF;
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
  animation: modalEnter 0.25s ease-out;
}

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

.modal-header {
  background: linear-gradient(135deg, var(--maroon-deep), var(--maroon));
  color: var(--gold-light);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--gold);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 800;
}

.modal-close {
  background: none;
  border: none;
  color: var(--gold-light);
  font-size: 20px;
  cursor: pointer;
}

.modal-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--cream-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
}

.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 154, 43, 0.2);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.btn-secondary {
  background: #EEE;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
}

.toast {
  background: var(--maroon-deep);
  color: var(--gold-light);
  border: 1px solid var(--gold);
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
}

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

/* API Tester console styling */
.api-console {
  background: #190C10;
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 20px;
  color: #F8F4EC;
  font-family: 'Consolas', 'Fira Code', monospace;
  font-size: 13px;
  max-height: 480px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Category Filter Pills */
.category-pill {
  background: var(--cream);
  color: var(--text-primary);
  border: 1px solid var(--cream-border);
  padding: 7px 15px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.category-pill:hover {
  background: #FFF1D6;
  border-color: var(--gold);
  color: var(--maroon);
}

.category-pill.active {
  background: var(--maroon);
  color: var(--gold-light);
  border-color: var(--maroon);
  box-shadow: 0 2px 8px rgba(103, 29, 45, 0.25);
}

