/* ============================================================
   Viswa Seva Sangha Trust — Admin Panel Styles
   ============================================================ */

/* ---- Admin body / shell ---- */
.admin-body {
  background: #f4f5fa;
  min-height: 100vh;
}
.admin-shell {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.admin-sidebar {
  width: 240px;
  min-height: 100vh;
  background: white;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  transition: transform 0.35s var(--ease-smooth);
  box-shadow: var(--shadow-soft);
}
@media (max-width: 1023px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-elegant);
  }
}

.admin-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}
.admin-site-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}
.admin-site-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
}
.sidebar-close-btn {
  display: none;
  padding: 0.375rem;
  border-radius: 0.5rem;
  color: var(--muted-foreground);
  transition: background 0.2s;
}
.sidebar-close-btn:hover { background: var(--secondary); }
@media (max-width: 1023px) { .sidebar-close-btn { display: flex; } }

.admin-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}
.admin-nav-link:hover { background: var(--secondary); color: var(--foreground); }
.admin-nav-link--active {
  background: rgba(126, 87, 194, 0.1);
  color: #7e57c2;
}
.admin-nav-link--active svg { color: #7e57c2; }

.admin-sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}
.admin-logout { color: var(--muted-foreground); }
.admin-logout:hover { background: hsla(0, 70%, 50%, 0.08); color: var(--destructive); }

/* ---- Main area ---- */
.admin-main {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
@media (max-width: 1023px) { .admin-main { margin-left: 0; } }

/* ---- Topbar ---- */
.admin-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.5rem;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: var(--shadow-soft);
}
.sidebar-toggle-btn {
  display: none;
  padding: 0.375rem;
  border-radius: 0.5rem;
  color: var(--muted-foreground);
  transition: background 0.2s;
  align-items: center;
}
.sidebar-toggle-btn:hover { background: var(--secondary); }
@media (max-width: 1023px) { .sidebar-toggle-btn { display: flex; } }

.admin-topbar-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
  flex: 1;
}
.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.admin-view-site-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  transition: color 0.2s;
}
.admin-view-site-link:hover { color: var(--primary); }
.admin-topbar-logout {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: color 0.2s;
}
.admin-topbar-logout:hover { color: var(--destructive); }

/* ---- Content area ---- */
.admin-content {
  flex: 1;
  padding: 2rem 1.5rem;
  max-width: 1200px;
  width: 100%;
}

/* ---- Admin cards ---- */
.admin-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow-soft);
}
.admin-card-body { padding: 1.5rem; }
.admin-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.admin-card-title { font-family: var(--font-serif); font-size: 1.125rem; font-weight: 600; }

/* ---- Dashboard stat cards ---- */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (min-width: 768px) {
  .dashboard-stats { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
  background: white;
  border: 1px solid rgba(126, 87, 194, 0.1);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(126, 87, 194, 0.05);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s var(--ease-smooth), box-shadow 0.3s;
  display: block;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 15px 35px rgba(126, 87, 194, 0.1); }

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.stat-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  background: rgba(126, 87, 194, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-card-icon svg { width: 1.25rem; height: 1.25rem; color: #7e57c2; }
.stat-pulse {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--destructive);
  animation: pulse 2s ease-in-out infinite;
}
.stat-card-value { font-family: var(--font-serif); font-size: 2rem; font-weight: 700; color: var(--foreground); }
.stat-card-label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted-foreground); margin-top: 0.25rem; }

/* ---- Quick actions ---- */
.quick-actions-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
}
.quick-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: hsla(36, 30%, 94%, 0.4);
  text-decoration: none;
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.2s;
}
.quick-action:hover { background: var(--secondary); }
.quick-action svg { width: 1rem; height: 1rem; color: var(--muted-foreground); transition: transform 0.2s; }
.quick-action:hover svg { transform: translateX(3px); }

/* ---- Admin form styles ---- */
.admin-form-group { margin-bottom: 1.25rem; }
.admin-form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}
.admin-form-input,
.admin-form-textarea,
.admin-form-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-form-input:focus,
.admin-form-textarea:focus,
.admin-form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px hsla(35, 60%, 45%, 0.12);
}
.admin-form-textarea { resize: vertical; min-height: 6rem; }

.admin-form-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .admin-form-row { grid-template-columns: repeat(2, 1fr); }
}

.admin-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.admin-checkbox-label input { width: 1rem; height: 1rem; accent-color: var(--primary); }

/* ---- List items ---- */
.admin-list { display: flex; flex-direction: column; gap: 0.75rem; }
.admin-list-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-soft);
}
.admin-list-item-body { flex: 1; min-width: 0; }
.admin-list-item-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.badge--festival     { background: hsla(42, 70%, 88%, 0.7); color: hsl(35, 55%, 30%); }
.badge--admission    { background: hsla(200, 70%, 88%, 0.7); color: hsl(200, 55%, 25%); }
.badge--announcement { background: hsla(270, 40%, 92%, 0.7); color: hsl(270, 40%, 35%); }
.badge--draft        { background: var(--muted); color: var(--muted-foreground); }
.badge--published    { background: hsla(142, 50%, 88%, 0.7); color: hsl(142, 45%, 25%); }
.badge--unread       { background: hsla(0, 70%, 92%, 0.7); color: hsl(0, 55%, 35%); }
.badge--read         { background: var(--muted); color: var(--muted-foreground); }

/* action buttons */
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border: none;
}
.btn-action--edit   { background: var(--secondary); color: var(--secondary-foreground); }
.btn-action--edit:hover { background: hsla(36, 30%, 88%, 1); }
.btn-action--delete { background: transparent; color: var(--destructive); }
.btn-action--delete:hover { background: hsla(0, 70%, 50%, 0.08); }
.btn-action--save   { background: #7e57c2; color: white; box-shadow: 0 4px 10px rgba(126, 87, 194, 0.25); }

/* ---- Gallery admin grid ---- */
.gallery-admin-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) {
  .gallery-admin-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .gallery-admin-grid { grid-template-columns: repeat(4, 1fr); }
}
.gallery-admin-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.gallery-admin-img { aspect-ratio: 4/3; width: 100%; object-fit: cover; display: block; }
.gallery-admin-body { padding: 0.75rem; }
.gallery-admin-caption {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
  word-break: break-word;
}
.gallery-admin-actions { display: flex; gap: 0.5rem; }

/* Upload area */
.upload-drop-area {
  border: 2px dashed var(--border);
  border-radius: 1rem;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: hsla(40, 38%, 98%, 0.5);
}
.upload-drop-area:hover, .upload-drop-area.dragover {
  border-color: var(--primary);
  background: hsla(35, 60%, 45%, 0.04);
}
.upload-drop-icon { width: 3rem; height: 3rem; margin: 0 auto 1rem; color: var(--muted-foreground); }
.upload-drop-text { font-size: 0.9375rem; color: var(--muted-foreground); margin-bottom: 0.5rem; }
.upload-drop-hint { font-size: 0.75rem; color: var(--muted-foreground); opacity: 0.7; }
#fileInput { display: none; }

/* Progress bar */
.progress-bar-wrap { background: var(--muted); border-radius: 999px; height: 0.5rem; overflow: hidden; margin-top: 1rem; }
.progress-bar { height: 100%; background: var(--gradient-gold); border-radius: 999px; transition: width 0.3s; }

/* ---- Contact submissions ---- */
.contact-sub-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-soft);
  margin-bottom: 0.75rem;
}
.contact-sub-item--unread { border-left: 3px solid var(--primary); }
.contact-sub-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.contact-sub-name { font-family: var(--font-serif); font-size: 1rem; font-weight: 600; }
.contact-sub-email { font-size: 0.8125rem; color: var(--muted-foreground); }
.contact-sub-date { font-size: 0.75rem; color: var(--muted-foreground); }
.contact-sub-message { font-size: 0.875rem; color: var(--muted-foreground); line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.contact-sub-actions { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }

/* ---- Split Login page ---- */
.split-login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e9efff;
  padding: 1.5rem;
  font-family: var(--font-sans);
}

.split-login-card {
  width: 100%;
  max-width: 1000px;
  background: white;
  border-radius: 1.25rem;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  box-shadow: 0 20px 40px rgba(0,0,0,0.06);
}

@media (min-width: 900px) {
  .split-login-card {
    grid-template-columns: 1fr 1fr;
    min-height: 600px;
  }
}

/* Left Pane (Purple) */
.split-left {
  background: linear-gradient(135deg, #7e57c2 0%, #ab47bc 100%);
  padding: 3rem;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.split-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: white;
  color: #7e57c2;
  padding: 0.375rem 1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  align-self: flex-start;
}

.split-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.split-desc {
  font-size: 0.9375rem;
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: 2.5rem;
}

/* Glass Feature Cards */
.split-feature-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(8px);
  transition: transform 0.2s, background 0.2s;
}
.split-feature-card:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(4px);
}
.split-feature-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.split-feature-icon svg { width: 1.25rem; height: 1.25rem; color: white; }
.split-feature-text h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
}
.split-feature-text p {
  font-size: 0.8125rem;
  opacity: 0.8;
  margin: 0;
}

/* Right Pane (White Form) */
.split-right {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

@media (min-width: 900px) {
  .split-right { padding: 4rem; }
}

.split-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2.5rem;
}

.split-right-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}
.split-right-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 2rem;
}

.split-input-wrap {
  position: relative;
  margin-bottom: 1.25rem;
}
.split-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}
.split-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #f8f9fc;
  font-size: 0.9375rem;
  color: var(--foreground);
  outline: none;
  transition: all 0.2s;
}
.split-input:focus {
  border-color: #7e57c2;
  background: white;
  box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.1);
}
.split-input-icon {
  position: absolute;
  left: 1rem;
  top: 2.3rem;
  color: var(--muted-foreground);
  pointer-events: none;
}
.split-input-icon svg { width: 1.125rem; height: 1.125rem; }

.split-toggle-pass {
  position: absolute;
  right: 1rem;
  top: 2.3rem;
  color: var(--muted-foreground);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
}
.split-toggle-pass:hover { color: var(--foreground); }

.split-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.split-checkbox-row input {
  width: 1rem;
  height: 1rem;
  accent-color: #7e57c2;
  cursor: pointer;
}
.split-checkbox-row label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  cursor: pointer;
}

.split-btn-primary {
  width: 100%;
  background: #7e57c2;
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.875rem;
  font-size: 0.9375rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}
.split-btn-primary:hover { background: #673ab7; transform: translateY(-1px); }

.split-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 600;
}
.split-divider::before, .split-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}
.split-divider:not(:empty)::before { margin-right: 1rem; }
.split-divider:not(:empty)::after { margin-left: 1rem; }

.split-btn-outline {
  width: 100%;
  background: white;
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.875rem;
  font-size: 0.9375rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.split-btn-outline:hover { background: #f8f9fc; border-color: #d1d5db; }

.login-error {
  background: hsla(0, 70%, 95%, 0.9);
  border: 1px solid hsl(0, 40%, 88%);
  color: hsl(0, 55%, 30%);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

/* ---- Empty states ---- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}
.empty-state-icon { width: 3rem; height: 3rem; margin: 0 auto 1rem; opacity: 0.4; }

/* ---- Loading spinner ---- */
.spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* ---- Sidebar overlay (mobile) ---- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: hsla(30, 15%, 15%, 0.4);
  z-index: 35;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* ---- Toast (reuse from main) ---- */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}
