/* ============================================================================
   TAMIL NADU SOCIAL AUDIT SOCIETY - ADMIN PORTAL STYLES
   Premium Creative UI & Advanced Design System
   ============================================================================ */

/* Import Fonts (if not already loaded in HTML) - assuming HTML loads them but GOOD to be safe or specific variations */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  /* Admin Specific Palette - More "Tech/Dashboard" feel but consistent with brand */
  --admin-bg: #f4f7fa;
  --admin-sidebar-bg: #ffffff;
  --admin-sidebar-width: 280px;
  --admin-header-height: 80px;

  /* Glassmorphism Variables */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  --gradient-accent: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  --gradient-surface: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);

  /* Animations */
  --ease-spring: cubic-bezier(0.43, 0.13, 0.23, 0.96);
}

/* ============================================================================
   LOGIN PAGE STYLES
   ============================================================================ */

.admin-login-body {
  background: var(--color-grey-50);
  background-image:
    radial-gradient(at 0% 0%, rgba(26, 35, 126, 0.1) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(245, 124, 0, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(0, 105, 92, 0.05) 0px, transparent 50%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', var(--font-primary);
  position: relative;
  overflow: hidden;
}

/* Decorational Orbs */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  z-index: 0;
  animation: floatOrb 20s infinite ease-in-out;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: rgba(26, 35, 126, 0.2);
  top: -100px;
  left: -100px;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: rgba(245, 124, 0, 0.15);
  bottom: -50px;
  right: -50px;
  animation-delay: -5s;
}

@keyframes floatOrb {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(30px, 50px);
  }
}

.login-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  width: 100%;
  max-width: 1000px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-2xl);
  box-shadow:
    0 20px 40px -10px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.5);
  overflow: hidden;
  z-index: 1;
  margin: var(--spacing-4);
}

/* Left Side - Visual */
.login-visual {
  background: var(--gradient-primary);
  padding: var(--spacing-10);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--color-white);
  position: relative;
  overflow: hidden;
}

.login-visual::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
}

.visual-content {
  position: relative;
  z-index: 2;
}

.logo-large {
  width: 80px;
  height: auto;
  margin-bottom: var(--spacing-6);
  background: white;
  padding: var(--spacing-2);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.visual-quote {
  margin-top: auto;
}

.quote-text {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  line-height: 1.4;
  margin-bottom: var(--spacing-4);
  font-style: italic;
  opacity: 0.9;
  color: #ffffff;
}

.quote-author {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
}

/* Right Side - Form */
.login-form-section {
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.form-header {
  margin-bottom: 40px;
}

.form-title {
  font-size: 2rem;
  color: var(--color-grey-900);
  margin-bottom: var(--spacing-2);
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.5px;
}

.form-subtitle {
  color: var(--color-grey-500);
  font-size: var(--font-size-base);
}

/* Floating Input Group */
.input-group {
  position: relative;
  margin-bottom: 24px;
}

.input-field {
  width: 100%;
  padding: 16px;
  border: 2px solid var(--color-grey-200);
  border-radius: var(--radius-lg);
  background: white;
  font-size: 1rem;
  transition: all 0.2s ease;
  color: var(--color-grey-900);
}

.input-field:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(26, 35, 126, 0.1);
}

.input-field:placeholder-shown+.input-label {
  transform: translateY(-50%) scale(1);
  top: 50%;
  left: 16px;
  color: var(--color-grey-500);
}

.input-label {
  position: absolute;
  top: 0;
  left: 12px;
  transform: translateY(-50%) scale(0.85);
  background: white;
  padding: 0 6px;
  font-size: 1rem;
  color: var(--color-primary);
  pointer-events: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

.input-field:focus+.input-label {
  top: 0;
  left: 12px;
  transform: translateY(-50%) scale(0.85);
  color: var(--color-primary);
}

/* CAPTCHA Specific Styles */
.captcha-group {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.captcha-image-wrapper {
  width: 130px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.captcha-img {
  width: 130px;
  height: 42px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-grey-200);
  cursor: pointer;
  transition: all 0.2s ease;
  object-fit: contain;
}

.captcha-img:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(26, 35, 126, 0.1);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--color-grey-600);
  font-size: 0.9rem;
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-grey-300);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

input[type="checkbox"]:checked+.remember-me .custom-checkbox {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

input[type="checkbox"]:checked+.remember-me .custom-checkbox::after {
  content: '✓';
  color: white;
  font-size: 12px;
}

.forgot-password {
  color: var(--color-primary);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
}

.btn-submit {
  width: 100%;
  padding: 16px;
  font-size: 1rem;
  background: var(--gradient-primary);
  border: none;
  color: white;
  border-radius: var(--radius-lg);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(26, 35, 126, 0.4);
}

.back-link {
  text-align: center;
  margin-top: 20px;
}

.back-link a {
  color: var(--color-grey-500);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.back-link a:hover {
  color: var(--color-primary);
}

@media (max-width: 900px) {
  .login-container {
    grid-template-columns: 1fr;
    max-width: 500px;
  }

  .login-visual {
    padding: 30px;
    min-height: 150px;
  }

  .visual-quote {
    display: none;
  }

  .login-form-section {
    padding: 40px;
  }
}

/* ============================================================================
   PRO PAGE EDITOR (Refined Content-First Layout)
   ============================================================================ */

.page-editor {
  display: flex;
  gap: 25px;
  margin: 20px 0;
  align-items: flex-start;
}

.editor-left {
  flex: 1;
  min-width: 0;
  /* Prevent flex overflow */
}

.editor-right {
  width: 380px;
  flex-shrink: 0;
}

.editor-card {
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, .05);
  border: 1px solid #edf2f7;
  margin-bottom: 25px;
}

.editor-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
  color: #2d3748;
}

.editor-card textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.95rem;
  transition: all 0.2s;
  resize: vertical;
}

.editor-card textarea:focus {
  border-color: #4facfe;
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
  outline: none;
}

/* Sticky Preview */
.preview-card {
  position: sticky;
  top: 20px;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
  border: 1px solid #edf2f7;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.preview-section {
  background: #f8fafc;
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
  border: 1px solid #e2e8f0;
}

.preview-section h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #718096;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 5px;
}

.preview-text {
  font-size: 0.9rem;
  color: #4a5568;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Status Badge */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-active {
  background: #c6f6d5;
  color: #22543d;
}

.status-inactive {
  background: #fed7d7;
  color: #742a2a;
}

/* ── Color Picker Group ── */
.mf-color-group {
  display: flex;
  align-items: center;
  gap: 15px;
  background: #f8fafc;
  padding: 8px 15px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  width: fit-content;
  min-width: 300px;
}

.mf-color-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 45px;
  height: 45px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.mf-color-input::-webkit-color-swatch {
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px #e2e8f0;
}

.mf-color-input::-moz-color-swatch {
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px #e2e8f0;
}

.color-preview {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.mf-color-group .mf-input-wrap {
  flex: 1;
}

.hex-input {
  background: transparent !important;
  border: none !important;
  font-family: 'Courier New', Courier, monospace;
  font-weight: 600;
  color: #475569;
  text-align: left !important;
  padding: 5px !important;
  width: 100px !important;
}

/* ── Modern Status Toggle Pill ── */
.status-toggle-card {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.status-toggle-card input[type="checkbox"] {
  display: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.status-toggle-card input:checked+.status-pill {
  background: #ecfdf5;
  color: #059669;
  border-color: #10b98133;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.1);
}

.status-toggle-card input:not(:checked)+.status-pill {
  background: #fef2f2;
  color: #dc2626;
  border-color: #ef444433;
}

.status-pill .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.3s;
}

.status-toggle-card input:checked+.status-pill .status-dot {
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  animation: status-pulse 2s infinite;
}

.status-toggle-card input:not(:checked)+.status-pill .status-dot {
  background: #ef4444;
}

.status-toggle-card input:checked+.status-pill::after {
  content: "Active";
}

.status-toggle-card input:not(:checked)+.status-pill::after {
  content: "Inactive";
}

@keyframes status-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.status-toggle-card:hover .status-pill {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

/* Responsive */
@media (max-width: 991px) {
  .page-editor {
    display: block;
  }

  .editor-right {
    width: 100%;
    margin-top: 25px;
  }

  .preview-card {
    position: static;
    max-height: none;
  }
}

/* ============================================================================
   DASHBOARD STYLES
   ============================================================================ */

.admin-body {
  background-color: var(--admin-bg);
  min-height: 100vh;
  display: flex;
}

/* Sidebar */
.admin-sidebar {
  width: var(--admin-sidebar-width);
  background: var(--admin-sidebar-bg);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width 0.3s var(--ease-spring);
}

.sidebar-header {
  height: var(--admin-header-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.sidebar-logo {
  width: 40px;
  height: 40px;
}

.sidebar-brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary-dark);
  line-height: 1.2;
}

.sidebar-brand span {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--color-grey-500);
}

.sidebar-nav {
  padding: 24px 16px;
  flex: 1;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-grey-400);
  margin-bottom: 12px;
  padding-left: 12px;
  font-weight: 600;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--color-grey-600);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 4px;
}

.admin-nav-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  color: var(--color-grey-400);
  transition: color 0.2s;
}

.admin-nav-item:hover,
.admin-nav-item.active {
  background: rgba(26, 35, 126, 0.04);
  color: var(--color-primary);
}

.admin-nav-item:hover i,
.admin-nav-item.active i {
  color: var(--color-primary);
}

.admin-nav-item.active {
  background: rgba(26, 35, 126, 0.08);
  font-weight: 600;
}

.logout-section {
  margin-top: auto;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 16px;
}

/* Main Content */
.admin-main {
  margin-left: var(--admin-sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Header */
.admin-header {
  height: var(--admin-header-height);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.header-search {
  position: relative;
  width: 300px;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid transparent;
  background: var(--color-grey-50);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.search-input:focus {
  background: white;
  border-color: var(--color-primary-light);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-grey-400);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 20px;
}

.notification-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: white;
  cursor: pointer;
  color: var(--color-grey-600);
  transition: all 0.2s;
}

.notification-btn:hover {
  background: var(--color-grey-50);
  color: var(--color-primary);
  transform: translateY(-2px);
}

.badge-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
  border: 2px solid white;
}

/* User Profile & Dropdown */
.user-profile {
  position: relative;
  background: white;
  border-radius: 50px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  z-index: 101;
}

.user-profile:hover,
.user-profile.active {
  background: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  border-color: rgba(26, 35, 126, 0.2);
  transform: translateY(-1px);
}

.profile-trigger {
  display: flex !important;
  align-items: center !important;
  gap: 12px;
  padding: 6px 14px 6px 6px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
}

.user-role {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 500;
}

.profile-arrow {
  font-size: 0.7rem;
  color: #94a3b8;
  transition: transform 0.3s ease;
  margin-left: 4px;
}

.user-profile.active .profile-arrow {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.profile-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 260px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 1000;
  overflow: hidden;
  transform-origin: top right;
  animation: dropdownFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-header {
  padding: 20px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.dropdown-user-name {
  display: block;
  font-weight: 800;
  color: #0f172a;
  font-size: 1rem;
}

.dropdown-user-role {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 4px;
}

.dropdown-body {
  padding: 8px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #475569;
  text-decoration: none !important;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.2s;
}

.dropdown-item i {
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
  color: #94a3b8;
  transition: color 0.2s;
}

.dropdown-item:hover {
  background: #f1f5f9;
  color: var(--color-primary);
}

.dropdown-item:hover i {
  color: var(--color-primary);
}

/* Logout Specific Styles */
.logout-item {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

/* Specific Logout Colors - Overriding all globals */
.dropdown-body .logout-link,
.logout-section .logout-link {
  color: #ef4444 !important;
}

.dropdown-body .logout-link i,
.logout-section .logout-link i {
  color: #ef4444 !important;
}

.dropdown-body .logout-link:hover,
.logout-section .logout-link:hover {
  background: #fef2f2 !important;
  color: #dc2626 !important;
}

.dropdown-body .logout-link:hover i,
.logout-section .logout-link:hover i {
  color: #dc2626 !important;
}

/* Content Area */
.admin-content {
  padding: 32px;
}

.page-header {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 8px;
  font-family: 'Outfit', sans-serif;
}

.page-breadcrumbs {
  font-size: 0.9rem;
  color: var(--color-grey-500);
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.03);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.icon-blue {
  background: #e3f2fd;
  color: #1565c0;
}

.icon-green {
  background: #e8f5e9;
  color: #2e7d32;
}

.icon-orange {
  background: #fff3e0;
  color: #ef6c00;
}

.icon-purple {
  background: #f3e5f5;
  color: #7b1fa2;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-grey-900);
  margin-bottom: 4px;
  font-family: 'Outfit', sans-serif;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--color-grey-500);
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  margin-top: 12px;
  font-weight: 500;
}

.trend-up {
  color: var(--color-success);
}

.trend-down {
  color: var(--color-danger);
}

/* Charts & Tables Section */
.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.card-box {
  background: white;
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(0, 0, 0, 0.03);
  box-shadow: var(--shadow-sm);
}

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

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-grey-900);
  font-family: 'Outfit', sans-serif;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.activity-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-grey-50);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
}

.activity-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-grey-900);
  margin-bottom: 4px;
}

.activity-content p {
  font-size: 0.85rem;
  color: var(--color-grey-500);
  margin-bottom: 4px;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--color-grey-400);
}

@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ============================================================================
   GLOBAL ADMIN COMPONENTS (Cards, Buttons, Forms, Tables)
   ============================================================================ */

/* Initial Variables Override for Admin */
:root {
  --admin-card-radius: 16px;
  --admin-input-radius: 8px;
  --admin-btn-radius: 8px;
}

/* CARDS */
.card {
  background: white;
  border-radius: var(--admin-card-radius);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);

  /* Drag Handle Styles */
  .drag-handle {
    color: #6b7280;
    cursor: move;
    transition: all 0.2s ease;
  }

  .drag-handle:hover {
    color: #2563eb;
    transform: scale(1.1);
  }

  padding: 24px;
  margin-bottom: 24px;
  transition: transform 0.2s,
  box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-grey-900);
  margin: 0;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  /* Increased from 10px 20px */
  font-size: 0.95rem;
  /* Slightly larger */
  font-weight: 500;
  border-radius: var(--admin-btn-radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 2px 4px rgba(26, 35, 126, 0.2);
}

.btn-primary:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(26, 35, 126, 0.3);
}

.btn-secondary {
  background: white;
  border-color: var(--color-grey-300);
  color: var(--color-grey-700);
}

.btn-secondary:hover {
  background: var(--color-grey-50);
  border-color: var(--color-grey-400);
  color: var(--color-grey-900);
}

.btn-danger {
  background: var(--color-danger);
  color: white;
}

.btn-danger:hover {
  background: #b71c1c;
  /* Darker red */
  box-shadow: 0 4px 8px rgba(198, 40, 40, 0.3);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* FORMS */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-grey-700);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.95rem;
  color: var(--color-grey-900);
  background-color: white;
  border: 1px solid var(--color-grey-300);
  border-radius: var(--admin-input-radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

.form-control::placeholder {
  color: var(--color-grey-400);
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px;
  appearance: none;
  padding-right: 36px;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

/* TABLES */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--admin-card-radius);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.table th,
.table td {
  padding: 14px 20px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-grey-100);
}

.table th {
  background: var(--color-grey-50);
  color: var(--color-grey-600);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table td {
  color: var(--color-grey-800);
  font-size: 0.9rem;
}

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

.table tr:hover td {
  background: var(--color-grey-50);
}

.table-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--color-grey-500);
  transition: all 0.2s;
  background: transparent;
  border: 1px solid transparent;
}

.action-btn:hover {
  background: var(--color-grey-100);
  color: var(--color-primary);
}

/* Conflict resolution for combined classes */
.action-btn.btn-primary {
  background: var(--color-primary);
  color: white;
}

.action-btn.btn-primary:hover {
  background: var(--color-primary-dark);
  color: white;
}

.action-btn.btn-info {
  background: #0288d1;
  color: white;
}

.action-btn.btn-info:hover {
  background: #01579b;
}

.action-btn.btn-warning {
  background: #ed6c02;
  color: white;
}

.action-btn.btn-warning:hover {
  background: #e65100;
}

.action-btn.btn-danger {
  background: var(--color-danger);
  color: white;
}

.action-btn.btn-danger:hover {
  background: #b71c1c;
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  /* Allow clicking through container */
}

.toast {
  background: white;
  min-width: 300px;
  max-width: 400px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 16px;
  pointer-events: auto;
  animation: slideInRight 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border-left: 4px solid var(--color-primary);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.toast.hiding {
  opacity: 0;
  transform: translateX(100%);
}

.toast-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.toast-icon {
  font-size: 1.25rem;
  margin-top: 2px;
}

.toast-content {
  flex: 1;
  font-size: 0.95rem;
  color: var(--color-grey-900);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--color-grey-400);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  transition: color 0.2s;
  margin-left: 8px;
}

.toast-close:hover {
  color: var(--color-grey-700);
}

/* Toast Variants */
.toast-success {
  border-left-color: var(--color-success);
}

.toast-success .toast-icon {
  color: var(--color-success);
}

.toast-error {
  border-left-color: var(--color-danger);
}

.toast-error .toast-icon {
  color: var(--color-danger);
}

.toast-warning {
  border-left-color: var(--color-warning);
}

.toast-warning .toast-icon {
  color: var(--color-warning);
}

.toast-info {
  border-left-color: var(--color-info);
}

.toast-info .toast-icon {
  color: var(--color-info);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Validation Errors */
label.error,
.error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

input.error,
select.error,
textarea.error {
  border-color: #dc3545;
}

/* Additional Validation Styling */
em.invalid {
  color: #ff172f;
  font-style: normal;
  display: block;
  font-size: 0.875rem;
  margin-top: 5px;
}

/* Badge Styles */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  line-height: 1;
  white-space: nowrap;
}

.badge-success {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid rgba(46, 125, 50, 0.2);
}

.badge-danger {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid rgba(198, 40, 40, 0.2);
}

/* Nested Menu Styles */
.menu-row {
  transition: background .2s;
}

.parent-menu {
  background: #f8f9fa;
  font-weight: 600;
}

.menu-row:hover {
  background: #e9ecef !important;
}

.toggle-icon {
  cursor: pointer;
  display: inline-block;
  width: 20px;
  margin-right: 6px;
  color: #666;
  user-select: none;
  transition: transform 0.2s;
}

.toggle-icon.open {
  transform: rotate(90deg);
}

.level-1 {
  padding-left: 30px;
}

.level-2 {
  padding-left: 60px;
}

.level-3 {
  padding-left: 90px;
}

.submenu-container {
  background: #f8f9fa;
}

.submenu-box {
  padding: 15px 30px;
}

/* Drag Handle */
.drag-handle {
  cursor: move;
  color: #adb5bd;
}

.drag-handle:hover {
  color: var(--color-primary);
}

/* ============================================================================
   PRO LEVEL FORM STYLES (PREMIUM UPGRADE)
   ============================================================================ */

.pro-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  /* Softer, deeper shadow */
  padding: 40px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.02);
}

/* Subtle Top Gradient Line */
.pro-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
}

.floating-group {
  position: relative;
  margin-bottom: 25px;
  /* More spacing */
}

/* Input Icon Styling */
.input-icon {
  position: absolute;
  left: 15px;
  top: 18px;
  /* Vertically centered relative to input height */
  color: #a0a0a0;
  font-size: 1.1rem;
  transition: .3s;
  z-index: 2;
}

.floating-group input,
.floating-group select {
  width: 100%;
  border: 1px solid #e0e0e0;
  padding: 14px 12px 14px 45px;
  /* Extra left padding for icon */
  border-radius: 10px;
  /* Softer corners */
  outline: none;
  transition: all .3s cubic-bezier(0.25, 0.8, 0.25, 1);
  background: #f9f9f9;
  /* Slight off-white bg */
  height: 54px;
  /* Taller inputs */
  font-size: 1rem;
  color: #333;
  appearance: none;
}

.floating-group label {
  position: absolute;
  left: 45px;
  /* Align with text start */
  top: 16px;
  color: #888;
  background: transparent;
  padding: 0 2px;
  transition: all .3s ease;
  pointer-events: none;
  font-weight: 500;
}

/* Focus States */
.floating-group input:focus,
.floating-group select:focus {
  border-color: #4facfe;
  background: #fff;
  box-shadow: 0 5px 15px rgba(79, 172, 254, 0.15);
}

.floating-group input:focus~.input-icon,
.floating-group input:not(:placeholder-shown)~.input-icon,
.floating-group select:focus~.input-icon,
.floating-group select.has-value~.input-icon {
  color: #4facfe;
  /* Icon lights up */
}

.floating-group input:focus~label,
.floating-group input:not(:placeholder-shown)~label,
.floating-group select:focus~label,
.floating-group select:valid~label,
.floating-group select.has-value~label {
  top: -10px;
  left: 10px;
  /* Move label to top-left corner */
  font-size: 11px;
  color: #4facfe;
  font-weight: 700;
  background: #fff;
  /* Mask line behind label */
  padding: 0 5px;
  border-radius: 4px;
}

/* Status Switch - Refined */
.status-switch {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
  background: #f8f9fa;
  padding: 10px 15px;
  border-radius: 10px;
  width: fit-content;
}

.switch {
  position: relative;
  width: 50px;
  height: 26px;
  display: inline-block;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  inset: 0;
  background: #e0e0e0;
  /* Neutral off */
  border-radius: 50px;
  transition: .3s cubic-bezier(0.4, 0.0, 0.2, 1);
  cursor: pointer;
}

.slider:before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: .3s cubic-bezier(0.4, 0.0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
  background: #3b82f6;
  /* Vibrant green */
}

input:checked+.slider:before {
  transform: translateX(24px);
}

#statusText {
  font-weight: 600;
  font-size: 0.95rem;
  color: #555;
  letter-spacing: 0.5px;
}

/* Password Strength - Sleek */
.strength-bar {
  height: 4px;
  border-radius: 20px;
  background: #e0e0e0;
  margin-top: 10px;
  overflow: hidden;
  width: 100%;
}

.strength-fill {
  height: 100%;
  width: 0%;
  background: #ff5252;
  transition: width .4s ease, background-color .4s ease;
}

/* Validation Message */
#userCheck {
  position: absolute;
  right: 15px;
  top: 18px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Buttons */
.btn-pro-primary {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-pro-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 172, 254, 0.5);
  color: white;
}

.btn-pro-secondary {
  background: #f1f3f5;
  color: #495057;
  border: none;
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-pro-secondary:hover {
  background: #e9ecef;
  color: #212529;
}

/* ============================================================================
   FLOATING LABEL FORM STYLES (Restored & Polished)
   ============================================================================ */

.floating-group {
  position: relative;
  margin-bottom: 25px;
}

.floating-group input,
.floating-group select {
  width: 100%;
  border: 1px solid #d1d9e6;
  /* Softer border */
  padding: 12px 14px;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease-in-out;
  background: #fff;
  height: 54px;
  /* Sufficient height for label */
  font-size: 1rem;
  color: #333;
  appearance: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.floating-group label {
  position: absolute;
  left: 12px;
  top: 16px;
  /* Centered visually */
  color: #6c757d;
  background: #fff;
  /* Key for hiding border behind label */
  padding: 0 4px;
  transition: all 0.2s ease-in-out;
  pointer-events: none;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1;
  z-index: 10;
}

/* Floating Action */
.floating-group input:focus,
.floating-group select:focus {
  border-color: #4facfe;
  box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.1);
}

.floating-group input:focus~label,
.floating-group input:not(:placeholder-shown)~label,
.floating-group select:focus~label,
.floating-group select:valid~label,
.floating-group select.has-value~label {
  top: -9px;
  left: 10px;
  font-size: 0.75rem;
  color: #4facfe;
  font-weight: 600;
}

/* Status Switch */
.status-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.switch {
  position: relative;
  width: 48px;
  height: 24px;
  display: inline-block;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  inset: 0;
  background: #e9ecef;
  /* Neutral off state */
  border-radius: 50px;
  transition: .3s;
  cursor: pointer;
}

.slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: .3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked+.slider {
  background: #3b82f6;
}

input:checked+.slider:before {
  transform: translateX(24px);
}

#statusText {
  font-weight: 600;
  font-size: 0.95rem;
  color: #495057;
}

/* Password Strength */
.strength-bar {
  height: 4px;
  border-radius: 20px;
  background: #e9ecef;
  margin-top: 8px;
  overflow: hidden;
  width: 100%;
}

.strength-fill {
  height: 100%;
  width: 0%;
  background: #dc3545;
  transition: all .3s ease;
}

/* Validation Message */
#userCheck {
  position: absolute;
  right: 14px;
  top: 18px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 10;
}

/* Adjust validation error position */
.floating-group label.error {
  color: #dc3545;
  font-size: 0.8rem;
  margin-top: 5px;
  display: block;
  margin-left: 2px;
}

/* ============================================================================
   PODCAST STUDIO EDITOR DESIGN (High Fidelity)
   ============================================================================ */

:root {
  --editor-bg: #f9fafb;
  --editor-card: #ffffff;
  --editor-border: #e5e7eb;
  --editor-text: #1f2937;
  --editor-label: #6b7280;
  --editor-primary: #8b5cf6;
  /* Purple Accent */
  --editor-primary-hover: #7c3aed;
}

body.admin-editor-page {
  background-color: var(--editor-bg);
}

/* 1. TOP HEADER BAR */
.editor-header {
  background: #fff;
  border-bottom: 1px solid var(--editor-border);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.back-btn {
  color: var(--editor-label);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
  text-decoration: none;
}

.back-btn:hover {
  color: var(--editor-text);
}

.page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--editor-text);
  margin: 0;
}

.status-pill {
  background: #000;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-header {
  background: #fff;
  border: 1px solid var(--editor-border);
  color: var(--editor-text);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-header:hover {
  background: #f3f4f6;
  color: var(--editor-text);
}

.btn-publish {
  background: var(--color-primary);
  border-color: var(--editor-primary);
  color: #fff;
}

.btn-publish:hover {
  background: rgb(53, 68, 205);
  color: #fff;
}


/* 2. MAIN LAYOUT */
.editor-layout {
  display: flex;
  gap: 0;
  /* Removing gap for flush look or keep small gap */
  height: calc(100vh - 70px);
  /* Subtract header height */
  overflow: hidden;
  margin: 0 -1.5rem;
  /* Negate container padding if needed */
}

/* Sidebar (Left Content) */
.editor-sidebar {
  flex: 1.2;
  /* Give more space to editor */
  overflow-y: auto;
  padding: 30px 50px;
  border-right: 1px solid var(--editor-border);
  background: #fff;
  min-width: 650px;
}

/* Preview Panel (Right Content) */
.editor-preview-panel {
  flex: 1;
  background: var(--editor-bg);
  overflow-y: auto;
  padding: 30px;
  display: flex;
  justify-content: center;
}


/* 3. TABS */
.editor-tabs {
  display: flex;
  background: #f3f4f6;
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 30px;
  width: fit-content;
}

.tab-link {
  padding: 6px 20px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--editor-label);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: transparent;
  text-decoration: none;
}

.tab-link:hover {
  text-decoration: none;
  color: var(--editor-text);
}

.tab-link.active {
  background: #fff;
  color: var(--editor-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}


/* 4. FORM ELEMENTS */
.form-section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--editor-text);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-badge {
  font-size: 0.7rem;
  color: var(--editor-primary);
  background: #ede9fe;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.prev-badge {
  font-size: 0.7rem;
  color: var(--editor-primary);
  background: #ede9fe;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.input-group-modern {
  margin-bottom: 20px;
  position: relative;
}

.label-modern {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--editor-label);
  margin-bottom: 6px;
}

.char-count {
  font-size: 0.75rem;
  color: #9ca3af;
}

.input-modern {
  width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--editor-border);
  border-radius: 30px;
  font-size: 1rem;
  color: var(--editor-text);
  transition: all 0.2s;
  background: #fff;
}

.input-modern:focus {
  border-color: var(--editor-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  outline: none;
}

textarea.input-modern {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

/* Image Uploader Modern */
.image-upload-box {
  border: 2px dashed var(--editor-border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  background: #fff;
}

.image-upload-box:hover {
  border-color: var(--editor-primary);
  background: #f9fafb;
}

/* 5. TOGGLES & SCHEDULE */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid transparent;
}

.toggle-item:hover {
  border-color: #e5e7eb;
}

.toggle-label {
  font-size: 0.9rem;
  color: var(--editor-text);
  font-weight: 500;
}


/* 6. PREVIEW CARD Styling */
.preview-paper {
  background: #fff;
  width: 100%;
  max-width: 800px;
  /* Increased from 480px for better desktop preview */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  padding: 40px;
  height: fit-content;
  min-height: 600px;
  border: 1px solid #f3f4f6;
}

.preview-meta {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
}

.preview-h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
  margin-bottom: 25px;
}

.preview-card-content {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-top: 0 !important;
}

.preview-content h1,
.preview-content h2,
.preview-content h3,
.preview-content h4 {
  color: #006699;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.preview-content h1 {
  font-size: 1.8rem;
}

.preview-content h2 {
  font-size: 1.5rem;
}

.preview-content h3 {
  font-size: 1.3rem;
}

.preview-content h4 {
  font-size: 1.1rem;
}

.preview-img-container {
  width: 100%;
  height: 240px;
  background: #f3f4f6;
  border-radius: 12px;
  margin-bottom: 25px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-icon {
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.8);
  position: absolute;
}

.preview-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #374151;
  word-wrap: break-word;
}

.preview-pills {
  display: flex;
  gap: 8px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.pill {
  font-size: 0.7rem;
  background: #f3f4f6;
  color: #4b5563;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.pill:before {
  content: "#";
  color: #9ca3af;
  margin-right: 2px;
}


/* UTILITIES */
.d-none {
  display: none !important;
}

.text-purple {
  color: var(--editor-primary);
}

/* Responsive */
@media (max-width: 1100px) {
  .editor-layout {
    display: block;
    height: auto;
    overflow: visible;
  }

  .editor-sidebar {
    border-right: none;
    min-width: 100%;
  }

  .editor-preview-panel {
    padding: 20px;
  }

  .editor-header {
    position: sticky;
    top: 0;
  }
}

/* ============================================================================
   CONTENT EDITOR TOOLS (File Manager & Code View)
   ============================================================================ */

.editor-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  background: #f1f5f9;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.tool-btn {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  /* Prevent wrapping */
  line-height: normal;
  flex-shrink: 0;
}

.tool-btn i {
  margin-right: 6px;
}

.tool-btn:hover {
  background: #fff;
  border-color: #94a3b8;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Modal Overlay */
.custom-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(2px);
}

.custom-modal-overlay.open {
  display: flex;
}

/* Modal Box */
.custom-modal {
  background: white;
  width: 90%;
  max-width: 800px;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.modal-title {
  font-weight: 700;
  color: #1e293b;
  font-size: 1.1rem;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #64748b;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  text-align: right;
}

/* File Grid */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 15px;
}

.file-item {
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  padding-bottom: 100%;
  /* Square aspect ratio */
}

.file-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-item:hover {
  border-color: #cbd5e1;
}

.file-item.selected {
  border-color: var(--editor-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* Code Editor (Notepad) */
.code-editor-area {
  width: 100%;
  height: 400px;
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  padding: 15px;
  border: none;
  border-radius: 8px;
  resize: none;
  line-height: 1.5;
}

.code-editor-area:focus {
  outline: none;
}