/* eGenius Modern Design System */
:root {
  /* Modern Color Palette */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);

  /* DARK THEME Background Colors - Properly Dark */
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-tertiary: #1a1a24;
  --bg-card: #1e1e2a;
  --bg-input: #2a2a3a;
  --bg-navbar: rgba(10, 10, 15, 0.95);
  --bg-dropdown: rgba(15, 15, 25, 0.98);

  /* DARK THEME Text Colors - High Contrast White */
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #a0aec0;
  --text-accent: #667eea;

  /* DARK THEME Accent Colors - Bright for Visibility */
  --accent-primary: #667eea;
  --accent-secondary: #764ba2;
  --accent-success: #48bb78;
  --accent-warning: #ed8936;
  --accent-danger: #f56565;

  /* DARK THEME Borders and Dividers */
  --border-color: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.05);
  --divider-color: rgba(255, 255, 255, 0.08);

  /* DARK THEME Shadows - Subtle but Visible */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.2), 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.3), 0 4px 6px rgba(0,0,0,0.2);

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
}

/* Global Modern Body Styling - DARK THEME */
body {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.03) 1px, transparent 0) !important;
  background-size: 30px 30px !important;
  padding-top: 90px !important; /* Account for navbar height + some buffer */
}

/* Force dark theme application - ensure all elements inherit dark theme */
[data-theme="dark"],
[data-theme="dark"] *,
[data-theme="dark"] body,
[data-theme="dark"] html {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

/* Ensure dark theme backgrounds are applied to all containers */
[data-theme="dark"] .container,
[data-theme="dark"] .container-fluid,
[data-theme="dark"] .row,
[data-theme="dark"] .col,
[data-theme="dark"] .card,
[data-theme="dark"] .modal,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .navbar {
  background: transparent !important;
}

/* Modern Card Design */
.modern-card {
  background: var(--bg-card) !important;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

/* Standard Bootstrap Card Dark Theme */
.card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-md) !important;
  color: var(--text-primary) !important;
}

.card-header {
  background: var(--bg-tertiary) !important;
  border-bottom: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

.card-body {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
}

.card-footer {
  background: var(--bg-secondary) !important;
  border-top: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

/* Card Titles and Headings - Ensure White in Dark Theme */
.card-title,
.card-subtitle,
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary) !important;
}

.card-title.tool-title,
.card-title.text-center {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}

/* Specific tool title styling */
.tool-title {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}

/* Bootstrap Badge Dark Theme */
.badge {
  color: var(--text-primary) !important;
  background-color: var(--bg-tertiary) !important;
  border: 1px solid var(--border-color) !important;
}

.badge.bg-secondary,
.badge.bg-light {
  background-color: var(--bg-secondary) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border-color) !important;
}

.badge.bg-primary {
  background: var(--accent-primary) !important;
  color: white !important;
}

.badge.bg-success {
  background: var(--accent-success) !important;
  color: white !important;
}

.badge.bg-info {
  background: var(--accent-primary) !important;
  color: white !important;
}

.badge.bg-warning {
  background: var(--accent-warning) !important;
  color: white !important;
}

.badge.bg-danger {
  background: var(--accent-danger) !important;
  color: white !important;
}

/* Feature badge specific styling */
.feature-badge {
  color: var(--text-secondary) !important;
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  font-weight: 500 !important;
}

/* Muted Text - Ensure Visibility in Dark Theme */
.text-muted,
.text-secondary,
.opacity-75,
.opacity-50 {
  color: var(--text-muted) !important;
}

.text-muted {
  color: #a0aec0 !important; /* Light gray for visibility on dark backgrounds */
}

/* Additional muted text classes */
.text-secondary {
  color: var(--text-secondary) !important;
}

.small,
.text-small {
  color: var(--text-muted) !important;
}

/* Form text and help text */
.form-text,
.text-help {
  color: var(--text-muted) !important;
}

/* Placeholder text */
::placeholder {
  color: var(--text-muted) !important;
  opacity: 0.7 !important;
}

/* Table Dark Theme */
.table {
  color: var(--text-primary) !important;
}

.card-header {
  background: var(--bg-tertiary) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
  min-height: 40px !important; /* Compact height for better proportions */
  padding: 0.5rem 1rem !important; /* Balanced padding with better horizontal spacing */
  display: flex !important;
  align-items: center !important;
}

/* Force button borders to be fully visible in card headers */
.card-header .btn {
  border: 1px solid !important;
  box-sizing: border-box !important;
  margin: 0.0625rem 0.0625rem !important;
  position: relative !important;
  z-index: 1 !important;
  border-radius: 0.375rem !important; /* Ensure consistent border radius */
}

/* Specific border colors for outline buttons in card headers */
.card-header .btn-outline-secondary,
.card-header .btn-outline-secondary.btn {
  border-color: #6c757d !important;
  color: #6c757d !important;
  border-width: 1px !important;
  border-style: solid !important;
}

/* Ultra-specific targeting for delete button borders */
.card-header .btn-outline-danger.delete-prompt-btn,
.card-header button.btn.btn-sm.btn-outline-danger.delete-prompt-btn,
.card-header .btn.btn-sm.btn-outline-danger.delete-prompt-btn {
  border: 1px solid #dc3545 !important;
  border-color: #dc3545 !important;
  border-width: 1px !important;
  border-style: solid !important;
  color: #dc3545 !important;
  background-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-box-shadow: none !important;
  -moz-box-shadow: none !important;
}

/* Force border visibility with CSS custom properties */
.card-header .btn-outline-danger.delete-prompt-btn::before,
.card-header .btn-outline-danger.delete-prompt-btn::after {
  border-color: #dc3545 !important;
}

/* Override any Bootstrap utility classes */
.card-header .btn-outline-danger.delete-prompt-btn.border-0 {
  border: 1px solid #dc3545 !important;
}

.card-header .btn-outline-danger.delete-prompt-btn.shadow-none {
  box-shadow: none !important;
}

.card-header .btn-outline-primary,
.card-header .btn-outline-primary.btn {
  border-color: #0d6efd !important;
  color: #0d6efd !important;
  border-width: 1px !important;
  border-style: solid !important;
}

.card-header .btn-outline-success,
.card-header .btn-outline-success.btn {
  border-color: #198754 !important;
  color: #198754 !important;
  border-width: 1px !important;
  border-style: solid !important;
}

/* Force outline-light button borders to be visible in card headers */
.card-header .btn-outline-light,
.card-header .btn-outline-light.btn,
.card-header .btn-outline-light.btn-sm,
.card-header a.btn.btn-outline-light.btn-sm,
.card-header.bg-primary .btn-outline-light,
.card-header.bg-primary a.btn.btn-outline-light.btn-sm {
  border: 2px solid rgba(244, 245, 248, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.8) !important;
  border-width: 2px !important;
  border-style: solid !important;
  color: #ffffff !important;
  background-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-box-shadow: none !important;
  -moz-box-shadow: none !important;
  position: relative !important;
  z-index: 2 !important;
}

/* Ensure button text is visible on dark backgrounds */
.card-header.bg-primary .btn-outline-light:hover,
.card-header.bg-primary a.btn.btn-outline-light.btn-sm:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-color: #ffffff !important;
  color: #fcfcfc !important;
}

/* Ensure favorite button (filled) also has proper styling */
.card-header .btn.favorite-btn {
  border: none !important;
  margin: 0.0625rem 0.0625rem !important;
}

.table tbody td {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

.table tbody tr:hover td {
  background: var(--bg-secondary) !important;
}

.modern-card:hover {
  box-shadow: 0 20px 25px rgba(0,0,0,0.15), 0 10px 10px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.modern-card-header {
  background: var(--primary-gradient);
  color: white;
  padding: var(--space-4);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin: subtract(var(--space-6), var(--space-4)) subtract(var(--space-6), var(--space-4)) var(--space-6) subtract(var(--space-6), var(--space-4));
}

/* Modern Button Styles */
.btn-modern {
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

/* Enhanced Button Borders for Better Visibility */
.btn {
  border-bottom: 2px solid rgba(0, 0, 0, 0.3) !important;
}

.btn-primary {
  border-bottom: 2px solid #0056b3 !important;
}

.btn-outline-secondary {
  border-bottom: 2px solid rgba(255, 255, 255, 0.2) !important;
}

/* Additional button variants for better border visibility */
.btn-outline-info {
  border-bottom: 2px solid rgba(13, 202, 240, 0.3) !important;
}

.btn-outline-success {
  border-bottom: 2px solid rgba(25, 135, 84, 0.3) !important;
}

.btn-outline-warning {
  border-bottom: 2px solid rgba(255, 193, 7, 0.3) !important;
}

.btn-outline-danger {
  border-bottom: 2px solid rgba(220, 53, 69, 0.3) !important;
}

.btn-outline-primary {
  border-bottom: 2px solid rgba(13, 110, 253, 0.3) !important;
}

.btn-success {
  border-bottom: 2px solid #0f5132 !important;
}

.btn-info {
  border-bottom: 2px solid #055160 !important;
}

.btn-warning {
  border-bottom: 2px solid #664d03 !important;
}

.btn-danger {
  border-bottom: 2px solid #842029 !important;
}

.btn-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: all 0.5s;
}

.btn-modern:hover::before {
  left: 100%;
}

.btn-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.btn-modern-secondary {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 0.75rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-modern-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Modern Form Controls */
.form-control-modern {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 0.75rem;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.form-control-modern:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: var(--bg-card);
}

.form-control-modern::placeholder {
  color: var(--text-muted);
}

/* Modern Labels */
.label-modern {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  display: block;
}

/* Modern Control Groups */
.control-group-modern {
  margin-bottom: var(--space-4);
}

/* Modern Spinner */
.spinner-modern {
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-left: 2px solid var(--accent-primary);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Modern Image Grid */
.image-grid-modern {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.image-card-modern {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.image-card-modern:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.image-card-modern img {
  width: 100%;
  height: auto;
  display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
  .modern-card {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
  }

  .image-grid-modern {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-2);
  }

  .btn-modern {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

/* Navbar Modern Styling */
.navbar-modern {
  background: rgba(0, 0, 0, 0.9) !important;
  backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: var(--shadow-lg) !important;
}

/* Custom Dropdown Menu */
.custom-dropdown-btn {
  font-size: 1rem;
  padding: 0;
  transition: all 0.3s ease;
}

.custom-dropdown-btn:hover {
  color: #667eea !important;
}

.custom-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  width: 220px;
  background: rgba(0, 0, 0, 0.98);
  backdrop-filter: blur(25px);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  overflow: hidden;
}

/* Special override for settings page */
.settings-dropdown-menu {
  position: relative !important;
  z-index: 20000 !important;
}

.custom-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.custom-dropdown-menu a {
  display: block;
  color: #e2e8f0;
  text-decoration: none;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.custom-dropdown-menu a:first-child {
  border-radius: 10px 10px 0 0;
}

.custom-dropdown-menu a:last-child {
  border-radius: 0 0 10px 10px;
  border-bottom: none;
}

.custom-dropdown-menu a:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: translateX(5px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.custom-dropdown-menu a:hover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* Overlay for mobile/menu clicks outside */
.custom-dropdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.custom-dropdown-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Status Badge */
.status-badge-modern {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary-gradient);
  color: white;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Utility Classes */
.glass-effect {
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.3);
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  z-index: 10;
}

/* Ensure spinner is visible in loading overlay */
.loading-overlay .spinner-border {
  border-color: rgba(255, 255, 255, 0.3);
  border-right-color: white;
}

/* Ensure all text in loading overlay is white */
.loading-overlay h1,
.loading-overlay h2,
.loading-overlay h3,
.loading-overlay h4,
.loading-overlay h5,
.loading-overlay h6,
.loading-overlay p,
.loading-overlay span,
.loading-overlay div {
  color: white !important;
}

.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Original responsive rules preserved */
@media (min-width: 800px) {
  #sample {
    min-width: 100%;
    width: auto;
    display: inline-block;
  }
}

@media (max-width: 800px) {
  #sample {
    min-width: 100%;
    width: auto;
    display: inline-block;
  }
}

@media (max-width: 800px) {
  #notes {
    min-width: 50%;
    width: auto;
    display: none;
  }
}

@media (min-width: 800px) {
  #notes {
    min-width: 50%;
    width: auto;
    display: inline-block;
  }
}

/* scroll to top */
#btn-back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none;
  background: var(--primary-gradient);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  color: white;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
}

#btn-back-to-top:hover {
  transform: scale(1.1);
}

/* Style for the thick blue separator */
.separator {
  border: 0;
  height: 4px;
  background: var(--accent-gradient);
  margin: 15px 0;
}

/* ThreadMaker specific styles */
.thread-item {
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.thread-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.thread-header {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.thread-header strong {
  color: var(--accent-primary);
}

.thread-header small {
  font-size: 0.8rem;
  opacity: 0.8;
}

.btn-success-custom {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  color: white;
}

.btn-success-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(72, 187, 120, 0.3);
  background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

/* Image Generation specific styles */
.image-gallery-modern {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 1rem;
}

.image-card-modern {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.image-card-modern:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.gallery-image {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-image:hover {
  filter: brightness(1.1);
}

.image-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  padding: 1rem;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
}

.image-card-modern:hover .image-actions {
  opacity: 1;
}

.image-actions .btn {
  border-radius: 50px;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal enhancements for image viewing */
.modal-content {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Wider textareas for prompts */
.prompt-textarea {
  font-family: 'Inter', monospace !important;
  font-size: 0.95rem !important;
  line-height: 1.5 !important;
  min-height: 120px !important;
  resize: vertical !important;
  width: 100% !important;
}

/* Better component arrangement */
.modern-card .card-body {
  padding: 2rem !important;
}

.modern-card .card-title {
  margin-bottom: 1.5rem !important;
  font-size: 1.25rem !important;
  font-weight: 600 !important;
}

/* Responsive adjustments for image gallery */
@media (max-width: 768px) {
  .image-gallery-modern {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }

  .gallery-image {
    height: 240px;
  }

  .modern-card .card-body {
    padding: 1.5rem !important;
  }
}

@media (max-width: 576px) {
  .image-gallery-modern {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .gallery-image {
    height: 250px;
  }

  .modern-card .card-body {
    padding: 1rem !important;
  }

  .prompt-textarea {
    font-size: 0.9rem !important;
    min-height: 100px !important;
  }
}

@media (max-width: 768px) {
  .textarea-container textarea {
    font-size: 12px;
  }
}

/* ===== LIGHT MODE STYLES ===== */
/* Define CSS custom properties for light theme colors */
:root {
  --light-primary: #667eea;
  --light-secondary: #764ba2;
  --light-bg: #f7fafc;
  --light-card-bg: #ffffff;
  --light-card-header-bg: #f8fafc;
  --light-card-header-text: #1a202c;
  --light-text: #1a202c;
  --light-muted-text: #718096;
}

[data-theme="light"] body {
  background: var(--light-bg) !important;
  color: var(--light-text) !important;
}

[data-theme="light"] {
  /* Light mode color variables */
  --text-primary: var(--light-text);
  --text-secondary: var(--light-muted-text);
  --bg-primary: var(--light-bg);
  --bg-secondary: var(--light-card-bg);
  --bg-card: var(--light-card-bg);
  --bg-input: var(--light-card-bg);
  --border-color: #cbd5e0;
}

[data-theme="light"] *,
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6,
[data-theme="light"] p,
[data-theme="light"] span,
[data-theme="light"] label,
[data-theme="light"] div,
[data-theme="light"] .text-white,
[data-theme="light"] .navbar-nav .nav-link,
[data-theme="light"] .brand-gradient {
  color: var(--light-text) !important;
}

[data-theme="light"] .status-indicator {
  color: #22543d !important;
}

[data-theme="light"] #charCount {
  color: #4a5568 !important;
}

[data-theme="light"] .content-area {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .input-area,
[data-theme="light"] .output-area {
  background: rgba(255, 255, 255, 0.9) !important;
  color: #1a202c !important;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .control-panel {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .navbar-test {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08) !important;
  color: #1a202c !important;
}

[data-theme="light"] .navbar-test .navbar-brand-test,
[data-theme="light"] .brand-gradient {
  color: #1a202c !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
  background-clip: initial !important;
}

[data-theme="light"] .dropdown-menu-test {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 2px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 25px 50px rgba(0,0,0,0.15) !important;
}

[data-theme="light"] .dropdown-menu-test a,
[data-theme="light"] .dropdown-menu-test a:hover,
[data-theme="light"] .dropdown-menu-test a:active,
[data-theme="light"] .dropdown-menu-test a:focus,
[data-theme="light"] .dropdown-menu-test a:visited {
  color: #1a202c !important;
}

[data-theme="light"] .dropdown-menu-test a:hover {
  background: var(--brand-gradient, linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--secondary-color, #764ba2) 100%));
  color: white !important;
}

[data-theme="light"] .status-indicator {
  background: rgba(72, 187, 120, 0.1);
  border: 1px solid #48bb78;
  color: #22543d;
}

[data-theme="light"] h1, [data-theme="light"] h5 {
  color: #1a202c;
}

[data-theme="light"] .card-title,
[data-theme="light"] .card-subtitle,
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6 {
  color: #1a202c !important;
}

/* Light theme button customization */
[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-primary-custom {
  background: linear-gradient(135deg, var(--light-primary) 0%, var(--light-secondary) 100%) !important;
  border-color: var(--light-primary) !important;
  color: white !important;
}

[data-theme="light"] .btn-secondary,
[data-theme="light"] .btn-secondary-custom,
[data-theme="light"] .btn-outline-secondary {
  background: rgba(0, 0, 0, 0.05) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: var(--light-text) !important;
}

[data-theme="light"] .btn-success {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%) !important;
  border-color: #48bb78 !important;
  color: white !important;
}

/* Light mode button bottom borders for better visibility */
[data-theme="light"] .btn {
  border-bottom: 2px solid rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] .btn-primary {
  border-bottom: 2px solid #0056b3 !important;
}

[data-theme="light"] .btn-outline-secondary {
  border-bottom: 2px solid rgba(0, 0, 0, 0.3) !important;
}

/* Additional light theme button variants for better border visibility */
[data-theme="light"] .btn-outline-info {
  border-bottom: 2px solid rgba(13, 202, 240, 0.3) !important;
}

[data-theme="light"] .btn-outline-success {
  border-bottom: 2px solid rgba(25, 135, 84, 0.3) !important;
}

[data-theme="light"] .btn-outline-warning {
  border-bottom: 2px solid rgba(255, 193, 7, 0.3) !important;
}

[data-theme="light"] .btn-outline-danger {
  border-bottom: 2px solid rgba(220, 53, 69, 0.3) !important;
}

[data-theme="light"] .btn-outline-primary {
  border-bottom: 2px solid rgba(13, 110, 253, 0.3) !important;
}

[data-theme="light"] .btn-success {
  border-bottom: 2px solid #0f5132 !important;
}

[data-theme="light"] .btn-info {
  border-bottom: 2px solid #055160 !important;
}

[data-theme="light"] .btn-warning {
  border-bottom: 2px solid #664d03 !important;
}

[data-theme="light"] .btn-danger {
  border-bottom: 2px solid #842029 !important;
}

[data-theme="light"] .btn-info {
  background: linear-gradient(135deg, var(--light-primary) 0%, var(--light-secondary) 100%) !important;
  border-color: var(--light-primary) !important;
  color: white !important;
}

[data-theme="light"] .btn-warning {
  background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%) !important;
  border-color: #ed8936 !important;
  color: white !important;
}

[data-theme="light"] .btn-danger {
  background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%) !important;
  border-color: #f56565 !important;
  color: white !important;
}

[data-theme="light"] .toast-notification {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #1a202c;
}

[data-theme="light"] select,
[data-theme="light"] select:not(:focus),
[data-theme="light"] select:valid,
[data-theme="light"] select:invalid,
[data-theme="light"] .form-select,
[data-theme="light"] .form-select:not(:focus),
[data-theme="light"] .form-select:valid,
[data-theme="light"] .form-select:invalid {
  color: #1a202c !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08) !important;
  opacity: 1 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

[data-theme="light"] select option,
[data-theme="light"] .form-select option {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #1a202c !important;
}

/* Light mode for modern cards and components */
[data-theme="light"] .modern-card {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07) !important;
}

[data-theme="light"] .form-control-modern {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: #1a202c !important;
}

[data-theme="light"] .form-control-modern:focus {
  border-color: #667eea !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
  background: #ffffff !important;
}

[data-theme="light"] .form-control-modern::placeholder {
  color: #a0aec0 !important;
}

/* Light mode for image gallery */
[data-theme="light"] .image-card-modern {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

/* Light mode for thread items */
[data-theme="light"] .thread-item {
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .thread-item:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}

/* Light Theme Card Styling - Fix Black Headers/Titles */
[data-theme="light"] .card {
  background: var(--light-card-bg) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06) !important;
  color: var(--light-text) !important;
}

[data-theme="light"] .card-header,
[data-theme="light"] .card-header * {
  background: var(--light-card-header-bg) !important;
  color: var(--light-card-header-text) !important;
  font-weight: 600 !important;
  border-bottom: none !important;
}

/* Override text-white class in card headers for light theme */
[data-theme="light"] .card-header.text-white,
[data-theme="light"] .card-header .text-white {
  color: var(--light-card-header-text) !important;
}

[data-theme="light"] .card-body {
  background: var(--light-card-bg) !important;
  color: var(--light-text) !important;
}

[data-theme="light"] .card-footer {
  background: var(--light-card-header-bg) !important;
  border-top: 1px solid #e2e8f0 !important;
  color: var(--light-text) !important;
}

/* Ensure all card titles are dark in light theme */
[data-theme="light"] .card-title,
[data-theme="light"] .card-subtitle {
  color: var(--light-text) !important;
  font-weight: 600 !important;
}

/* Card titles inside card headers should use card header text color */
[data-theme="light"] .card-header .card-title,
[data-theme="light"] .card-header .card-subtitle {
  color: var(--light-card-header-text) !important;
}

/* Specific card header background colors for different Bootstrap classes - use custom property when no specific class */
[data-theme="light"] .card-header:not(.bg-primary):not(.bg-info):not(.bg-success):not(.bg-warning):not(.bg-danger):not(.bg-secondary):not(.bg-light) {
  background: var(--light-card-header-bg) !important;
}

[data-theme="light"] .card-header.bg-primary {
  background: var(--light-card-header-bg) !important;
  color: var(--light-card-header-text) !important;
  border-bottom-color: #b3d9ff !important;
}

[data-theme="light"] .card-header.bg-info {
  background: var(--light-card-header-bg) !important;
  color: var(--light-card-header-text) !important;
  border-bottom-color: #b3e0ff !important;
}

[data-theme="light"] .card-header.bg-success {
  background: var(--light-card-header-bg) !important;
  color: var(--light-card-header-text) !important;
  border-bottom-color: #c6f6d5 !important;
}

[data-theme="light"] .card-header.bg-warning {
  background: var(--light-card-header-bg) !important;
  color: var(--light-card-header-text) !important;
  border-bottom-color: #ffeaa7 !important;
}

[data-theme="light"] .card-header.bg-danger {
  background: var(--light-card-header-bg) !important;
  color: var(--light-card-header-text) !important;
  border-bottom-color: #feb2b2 !important;
}

[data-theme="light"] .card-header.bg-secondary {
  background: var(--light-card-header-bg) !important;
  color: var(--light-card-header-text) !important;
  border-bottom-color: #e2e8f0 !important;
}

[data-theme="light"] .card-header.bg-light {
  background: var(--light-card-header-bg) !important;
  color: var(--light-card-header-text) !important;
  border-bottom-color: #e2e8f0 !important;
}

/* ===== CUSTOM APPLICATION STYLES ===== */

/* Full-width layout container */
.fullwidth-layout {
  max-width: none !important;
  padding: 0 15px;
}

/* Modern navbar */
.navbar-modern {
  background: rgba(0, 0, 0, 0.9) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

/* Brand gradient */
.brand-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  font-size: 2rem;
}

/* Large content areas */
.content-area {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
}

.input-area {
  min-height: 400px;
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 1rem;
  color: white;
  resize: vertical;
  background: rgba(0, 0, 0, 0.2) !important;
}

.output-area {
  min-height: 500px;
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 1rem;
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

/* Reduce title sizes - removed h1 override to allow Bootstrap classes to work properly */
h5 { font-size: 1rem; }

/* Reduce dropdown text size */
.form-select, .form-select option {
  font-size: 0.85rem !important;
}

/* Reduce button text size */
.btn {
  font-size: 0.85rem !important;
}

/* Reduce status text size */
.status-indicator span,
.status-indicator {
  font-size: 0.8rem !important;
}

/* Reduce character count text */
#charCount {
  font-size: 0.75rem !important;
}

/* Reduce navbar text */
.navbar-nav .nav-link {
  font-size: 0.9rem;
}

/* Parent container for relative positioning */
.navbar-nav .nav-item {
  position: relative;
}

/* Custom Dropdown Menu */
.custom-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-20px) scale(0.95);
  width: 220px;
  background: rgba(0, 0, 0, 0.95) !important;
  backdrop-filter: blur(25px) !important;
  border: 2px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5) !important;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  overflow: hidden;
}

.custom-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

.custom-dropdown-menu a {
  display: block;
  color: #e2e8f0;
  text-decoration: none;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.custom-dropdown-menu a:last-child {
  border-bottom: none;
}

.custom-dropdown-menu a:hover {
  background: var(--brand-gradient, linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--secondary-color, #764ba2) 100%));
  color: white;
  transform: translateX(5px);
}

/* Control buttons */
.control-panel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
}

.btn-primary-custom {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 10px;
  padding: 0.75rem 2rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.btn-secondary-custom {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-secondary-custom:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Status badge */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 128, 0, 0.2);
  border: 1px solid rgba(0, 128, 0, 0.3);
  border-radius: 20px;
  color: #90EE90;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Textarea and select styling - ensure white text on focus */
.form-control:focus,
.form-control:active,
.form-control:focus-visible,
textarea:focus,
textarea:active,
textarea:focus-visible,
.input-area:focus,
.input-area:active,
.input-area:focus-visible {
  color: white !important;
  background-color: rgba(0, 0, 0, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Select dropdown styling - fix white background issue */
.form-select:focus,
.form-select:focus-visible,
.form-select:active,
.form-select {
  color: white !important;
  background-color: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}

.form-select option {
  background-color: rgba(0,0,0,0.95) !important;
  color: white !important;
  padding: 0.5rem !important;
}

/* Toast notification */
.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: all 0.3s ease;
}

/* Fixed size image styling for image.html */
.fixed-size-image {
  width: 256px !important;
  height: 256px !important;
  object-fit: cover;
  display: block;
}

.toast-notification.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.toast-notification.success {
  border-color: #48bb78;
  background: rgba(72, 187, 120, 0.1);
}

.toast-notification.error {
  border-color: #f56565;
  background: rgba(245, 101, 101, 0.1);
}

/* Application responsive design */
@media (max-width: 768px) {
  .fullwidth-layout {
    padding: 0 10px;
  }
  .input-area, .output-area {
    padding: 1rem;
    font-size: 1rem;
  }
  .toast-notification {
    left: 10px;
    right: 10px;
    top: 10px;
  }

  /* Mobile dropdown positioning */
  .custom-dropdown-menu {
    left: 50% !important;
    transform: translateX(-50%) translateY(-20px) scale(0.95) !important;
    width: 200px !important;
    max-width: 90vw !important;
  }

  .custom-dropdown-menu.show {
    transform: translateX(-50%) translateY(0) scale(1) !important;
  }

  /* Mobile navbar adjustments */
  .navbar-nav .nav-item {
    margin-right: 0;
  }

  .custom-dropdown-btn {
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
  }
}

/* Mobile menu specific adjustments for hamburger behavior */
@media (max-width: 576px) {
  .custom-dropdown-menu {
    top: 120% !important; /* Move it further down on very small screens */
    min-width: 180px !important;
  }

  .custom-dropdown-btn {
    display: block;
    width: 100% !important;
    text-align: center !important;
    padding: 10px !important;
  }
}

/* ===== IMAGE GENERATION STYLES ===== */

/* Enhanced Navbar Styles for Testing */
.navbar-test {
  background: linear-gradient(135deg, rgba(0,0,0,0.95) 0%, rgba(15,15,35,0.95) 50%, rgba(26,26,46,0.95) 100%) !important;
  backdrop-filter: blur(25px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3) !important;
  min-height: 70px;
}

/* Brand Logo Styles */
.navbar-brand-test {
  display: flex !important;
  align-items: center !important;
  padding: 0 !important;
  margin-right: 2rem !important;
}

.brand-logo {
  height: 80px !important;
  width: auto !important;
  object-fit: contain !important;
  transition: all 0.3s ease !important;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)) !important;
}

.navbar-brand-test:hover .brand-logo {
  transform: scale(1.05) !important;
}

/* Light Theme Brand Styles */
[data-theme="light"] .brand-logo {
  filter: none !important;
}

/* Responsive Logo Sizing */
@media (max-width: 768px) {
  .brand-logo {
    height: 32px !important;
  }
}

@media (max-width: 576px) {
  .brand-logo {
    height: 28px !important;
  }
}

/* Ensure logo scales with text height */
.brand-logo {
  height: 1em !important; /* Match text height */
  width: auto !important; /* Maintain aspect ratio */
  max-height: 1.2em !important; /* Slightly larger than text for visibility */
}

/* Dark mode navbar brand - ensure it's light colored */
[data-theme="dark"] .navbar-brand-test {
  color: #ffffff !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
  background-clip: initial !important;
}

/* Add top padding for fixed navbar */
body {
  padding-top: 90px !important; /* Account for navbar height + some buffer */
}

.navbar-brand-test {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  font-size: 1.8rem;
  text-decoration: none;
  margin-right: 2rem;
}

.navbar-brand-test:hover {
  transform: scale(1.05);
  transition: all 0.3s ease;
}

/* Enhanced Menu Button */
.menu-toggle-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.menu-toggle-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: all 0.5s;
}

.menu-toggle-btn:hover::before {
  left: 100%;
}

.menu-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.menu-toggle-btn:active {
  transform: translateY(0);
}

/* Enhanced Dropdown Menu */
.dropdown-menu-test {
  position: absolute;
  top: 100%;
  right: 0;
  width: 240px;
  background: linear-gradient(135deg, rgba(0,0,0,0.98) 0%, rgba(15,15,35,0.98) 100%);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  overflow: hidden;
  margin-top: 10px;
}

/* Mobile Scrollable Dropdown */
@media (max-width: 768px) {
  .dropdown-menu-test {
    width: 220px;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
  }
  
  /* Custom scrollbar styling for mobile */
  .dropdown-menu-test::-webkit-scrollbar {
    width: 6px;
  }
  
  .dropdown-menu-test::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
  }
  
  .dropdown-menu-test::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
  }
  
  .dropdown-menu-test::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
  }
}

.dropdown-menu-test.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-menu-test::before {
  content: '';
  position: absolute;
  top: -8px;
  right: 20px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid rgba(255, 255, 255, 0.1);
}

.dropdown-menu-test::after {
  content: '';
  position: absolute;
  top: -6px;
  right: 21px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid rgba(0,0,0,0.98);
}

/* Menu Sections */
.menu-section {
  margin-bottom: 8px;
}

.menu-section:last-child {
  margin-bottom: 0;
}

/* Section Titles */
.menu-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--menu-section-title-color, #a0aec0);
  border-bottom: 1px solid var(--menu-section-title-border, rgba(255, 255, 255, 0.1));
  background: linear-gradient(90deg, transparent, var(--menu-divider-bg, rgba(102, 126, 234, 0.2)), transparent);
  position: relative;
}

.menu-section-title i {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Menu Items */
.menu-item-test {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #e2e8f0;
  text-decoration: none;
  padding: 12px 18px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border-bottom: none;
}

.menu-item-test:not(.menu-item-danger) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.menu-item-test:last-child {
  border-bottom: none;
}

.menu-item-test::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--menu-item-hover-bg, linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--secondary-color, #764ba2) 100%));
  transition: width 0.3s ease;
  z-index: -1;
}

.menu-item-test:hover::before {
  width: 100%;
}

.menu-item-test:hover {
  color: white;
  transform: translateX(8px);
  text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.menu-item-test i {
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.menu-item-test:hover i {
  transform: scale(1.1);
}

.menu-item-test span {
  font-weight: 500;
  font-size: 0.95rem;
}

/* Danger Items (Logout) */
.menu-item-danger {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 8px;
  border-bottom: none !important;
}

.menu-item-danger::before {
  background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

.menu-item-danger:hover {
  color: #fff;
  text-shadow: 0 0 10px rgba(229, 62, 62, 0.5);
}

/* Light Theme Overrides */
[data-theme="light"] .dropdown-menu-test {
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.95) 100%);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

[data-theme="light"] .menu-section-title {
  color: #4a5568;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
}

[data-theme="light"] .menu-item-test {
  color: #1a202c;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .menu-item-test:hover {
  color: #1a202c;
  text-shadow: none;
}

[data-theme="light"] .menu-item-test::before {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

[data-theme="light"] .menu-item-danger::before {
  background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

/* User Menu Section */
.user-menu-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
  margin-top: 8px;
}

.user-menu-section .menu-item-test {
  padding: 12px 18px;
  font-size: 0.9rem;
}

/* Unified Navbar Action Buttons */
.navbar-action-btn {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  min-width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.navbar-action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: all 0.5s;
}

.navbar-action-btn:hover::before {
  left: 100%;
}

.navbar-action-btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
  color: white;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.navbar-action-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.navbar-action-btn i {
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.navbar-action-btn:hover i {
  transform: scale(1.1);
}

/* Dashboard Button Specific Styling */
.dashboard-btn {
  border-left: 3px solid rgba(102, 126, 234, 0.3);
}

.dashboard-btn:hover {
  border-left-color: rgba(102, 126, 234, 0.8);
}

/* Dark Mode Button Specific Styling */
.dark-mode-btn {
  border-left: 3px solid rgba(255, 215, 0, 0.3);
}

.dark-mode-btn:hover {
  border-left-color: rgba(255, 215, 0, 0.8);
}

/* Menu Button Specific Styling */
.menu-btn {
  border-left: 3px solid rgba(102, 126, 234, 0.3);
}

.menu-btn:hover {
  border-left-color: rgba(102, 126, 234, 0.8);
}

/* Enhanced Menu Button (keep existing enhanced styling) */
.menu-toggle-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.menu-toggle-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: all 0.5s;
}

.menu-toggle-btn:hover::before {
  left: 100%;
}

.menu-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.menu-toggle-btn:active {
  transform: translateY(0);
}

/* Mobile Dark Mode Toggle (keep existing styling) */
.dark-mode-toggle-test {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 10px;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dark-mode-toggle-test:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: scale(1.05);
}

/* Mobile Styles */
@media (max-width: 768px) {
  .navbar-test {
    padding: 0.5rem 1rem;
    min-height: 60px;
  }

  .navbar-brand-test {
    font-size: 1.5rem;
    margin-right: 1rem;
  }

  .menu-toggle-btn {
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  .dropdown-menu-test {
    width: 260px;
    right: -10px;
    margin-top: 8px;
  }

  .dark-mode-toggle-test {
    margin-left: 0.5rem;
    padding: 8px;
  }
}

@media (max-width: 576px) {
  .navbar-test {
    padding: 0.5rem;
  }

  .dropdown-menu-test {
    width: calc(100vw - 20px);
    max-width: 300px;
    right: 10px;
  }

  .menu-toggle-btn {
    width: 100%;
    text-align: center;
    margin: 0.5rem 0;
  }

  .navbar-brand-test {
    font-size: 1.3rem;
  }
}

/* Test Content */
.test-content {
  padding: 2rem 0;
  min-height: 60vh;
  transition: all 0.3s ease;
}

.feature-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.feature-card h3 {
  color: #667eea;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.feature-card p {
  color: #e2e8f0;
  line-height: 1.6;
  transition: all 0.3s ease;
}

/* Light Mode Styles */
[data-theme="light"] .test-content {
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 50%, #e2e8f0 100%);
}

[data-theme="light"] .feature-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .feature-card h3 {
  color: #2d3748;
}

[data-theme="light"] .feature-card p {
  color: #4a5568;
}

[data-theme="light"] h1 {
  color: #1a202c !important;
}

[data-theme="light"] .text-muted {
  color: #718096 !important;
}

/* ===== MODEL MANAGEMENT STYLES ===== */

/* Model management table header */
thead.table-dark th {
  background-color: #000000 !important;
  color: white !important;
  border-color: #000000 !important;
}

/* ===== IMAGE TOOLS DASHBOARD STYLES ===== */

/* Image Tools Dashboard CSS Custom Properties */
:root {
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(0, 0, 0, 0.05);
  --shadow-light: 0 2px 15px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Theme-aware glass backgrounds for image tools */
[data-theme="light"] {
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --glass-bg: rgba(0, 0, 0, 0.3);
  --glass-border: rgba(255, 255, 255, 0.1);
}

/* Image Tools Page Header */
.page-header {
  background: var(--gradient-primary);
  color: white;
  padding: 3rem 0;
  margin-bottom: 3rem;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.page-header h1 {
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-header p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 0;
}

/* Tool Cards */
.tool-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  height: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  z-index: 1;
}

.tool-card:hover::before {
  transform: scaleX(1);
}

.tool-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(102, 126, 234, 0.2);
}

.tool-image {
  height: 180px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
  transition: transform 0.3s ease;
}

.tool-card:hover .tool-image {
  transform: scale(1.05);
}

.tool-icon {
  font-size: 2.5rem;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.tool-card:hover .tool-icon {
  transform: scale(1.1) rotate(5deg);
  color: var(--bs-primary) !important;
}

.feature-badge {
  background: rgba(102, 126, 234, 0.1);
  color: var(--bs-primary);
  border: 1px solid rgba(102, 126, 234, 0.2);
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  margin: 0.125rem;
  border-radius: 20px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.tool-card:hover .feature-badge {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.tool-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.tool-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.btn-outline-primary {
  border-color: var(--bs-primary);
  color: var(--bs-primary);
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.cta-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 0;
  margin-top: 3rem;
  border-radius: 20px 20px 0 0;
}

.cta-section h3 {
  font-weight: 700;
  margin-bottom: 1rem;
}

.cta-section .btn {
  transition: all 0.3s ease;
}

.cta-section .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Category Headers */
.category-header {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--glass-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.category-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.category-divider {
  border: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gradient-primary), transparent);
  margin: 1rem 0;
}

/* Tool Card Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tool-card {
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.tool-card:nth-child(1) { animation-delay: 0.1s; }
.tool-card:nth-child(2) { animation-delay: 0.2s; }
.tool-card:nth-child(3) { animation-delay: 0.3s; }
.tool-card:nth-child(4) { animation-delay: 0.4s; }
.tool-card:nth-child(5) { animation-delay: 0.5s; }
.tool-card:nth-child(6) { animation-delay: 0.6s; }
.tool-card:nth-child(7) { animation-delay: 0.7s; }
.tool-card:nth-child(8) { animation-delay: 0.8s; }

/* Image Tools Responsive Design */
@media (max-width: 768px) {
  .tool-image {
    height: 140px;
  }

  .page-header {
    padding: 2rem 0;
    border-radius: 0 0 15px 15px;
  }

  .page-header h1 {
    font-size: 2rem;
  }
}

/* Provider logo styles */
.provider-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border: 1px solid #dee2e6;
  border-radius: 3px;
  background: white;
  vertical-align: middle;
}

.provider-fallback {
  font-size: 0.75rem;
  font-weight: 500;
  color: #6c757d;
  vertical-align: middle;
}

/* Model name truncation for mobile */
.model-name-cell {
  max-width: 200px;
}

.model-name-text {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.model-name-link {
  color: inherit;
}

.model-name-link:hover .model-name-text {
  color: #667eea;
}

/* Mobile responsive table styles */
@media (max-width: 768px) {
  .table-mobile-compact {
    font-size: 0.875rem;
  }

  .table-mobile-compact th,
  .table-mobile-compact td {
    padding: 0.5rem 0.25rem;
    white-space: nowrap;
  }

  .table-mobile-compact .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  .table-mobile-compact .btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  .provider-logo {
    width: 16px;
    height: 16px;
  }

  .model-name-cell {
    max-width: 120px;
  }

  /* Make type badges more compact on mobile */
  .table-mobile-compact .badge {
    display: inline-block;
    min-width: 40px;
    text-align: center;
  }
}

@media (max-width: 576px) {
  .model-name-cell {
    max-width: 80px;
  }

  .table-mobile-compact th,
  .table-mobile-compact td {
    padding: 0.25rem;
  }
}

/* ===== PROMPTS PAGE DARK MODE FIXES ===== */

/* Fix links visibility in dark mode for prompts page - Higher specificity needed */
[data-theme="dark"] .elementor a,
[data-theme="dark"] .elementor a:hover,
[data-theme="dark"] .elementor a:visited,
[data-theme="dark"] .elementor a:active,
[data-theme="dark"] .elementor a:focus {
  color: #ffffff !important;
  text-decoration: underline !important;
  text-decoration-color: rgba(255, 255, 255, 0.6) !important;
}

/* Fix Elementor heading colors in dark mode */
[data-theme="dark"] .elementor-heading-title {
  color: #ffffff !important;
}

/* Fix Elementor text colors in dark mode */
[data-theme="dark"] .elementor a,
[data-theme="dark"] .elementor p,
[data-theme="dark"] .elementor h1,
[data-theme="dark"] .elementor h2,
[data-theme="dark"] .elementor h3,
[data-theme="dark"] .elementor h4,
[data-theme="dark"] .elementor h5,
[data-theme="dark"] .elementor h6,
[data-theme="dark"] .elementor li,
[data-theme="dark"] .elementor span {
  color: #e2e8f0 !important;
}

/* More aggressive inline style overrides - target specific Elementor classes and inline styles */
[data-theme="dark"] span[style*="color:#000000"],
[data-theme="dark"] a[style*="color:#000000"],
[data-theme="dark"] [style*="color:#000000"],
[data-theme="dark"] span[style*="color:#000000"] a,
[data-theme="dark"] .elementor span[style*="color:#000000"],
[data-theme="dark"] .elementor a[style*="color:#000000"] {
  color: #ffffff !important;
}

[data-theme="dark"] a[style*="text-decoration:underline"],
[data-theme="dark"] span[style*="text-decoration:underline"],
[data-theme="dark"] [style*="text-decoration:underline"] {
  text-decoration: underline !important;
  text-decoration-color: rgba(255, 255, 255, 0.6) !important;
}

/* Target table of contents spans and links specifically */
[data-theme="dark"] .table-of-contents span,
[data-theme="dark"] .table-of-contents a,
[data-theme="dark"] .table-of-contents li,
[data-theme="dark"] .table-of-contents ul li a,
[data-theme="dark"] .table-of-contents ul li span {
  color: #ffffff !important;
}

[data-theme="dark"] .table-of-contents a:hover,
[data-theme="dark"] .table-of-contents span:hover {
  color: #667eea !important;
}

[data-theme="dark"] .table-of-contents span[style*="text-decoration:underline"],
[data-theme="dark"] .table-of-contents a[style*="text-decoration:underline"] {
  text-decoration: underline !important;
  text-decoration-color: rgba(255, 255, 255, 0.6) !important;
}

/* Override content area inline styles with maximum specificity */
[data-theme="dark"] .content-area span[style*="color:#000000"],
[data-theme="dark"] .content-area a[style*="color:#000000"],
[data-theme="dark"] .elementor-element span[style*="color:#000000"],
[data-theme="dark"] .elementor-element a[style*="color:#000000"] {
  color: #ffffff !important;
}

[data-theme="dark"] .content-area a,
[data-theme="dark"] .elementor-widget-container a {
  color: #ffffff !important;
  text-decoration-color: rgba(255, 255, 255, 0.6) !important;
}

[data-theme="dark"] .content-area a:hover,
[data-theme="dark"] .elementor-widget-container a:hover {
  color: #667eea !important;
}

/* Fix table styling in dark mode */
[data-theme="dark"] table,
[data-theme="dark"] th,
[data-theme="dark"] td {
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] tbody {
  background: transparent !important;
}

/* Ensure proper contrast for list items and paragraphs */
[data-theme="dark"] .elementor ul li,
[data-theme="dark"] .elementor ol li {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .elementor p,
[data-theme="dark"] .elementor div:not(.elementor-widget-container) {
  color: #e2e8f0 !important;
}

/* Force light text in all Elementor content */
[data-theme="dark"] .elementor-element .elementor-widget-container *,
[data-theme="dark"] .elementor-section *,
[data-theme="dark"] .elementor-element * {
  color: inherit !important;
}

/* Fix Elementor specific dark mode issues */
[data-theme="dark"] .elementor-widget-container,
[data-theme="dark"] .elementor-section,
[data-theme="dark"] .elementor-column {
  background-color: transparent !important;
}

/* Static Copy Buttons */
.static-copy-btn {
  transition: all 0.2s ease;
  border-radius: 4px !important;
  opacity: 0.7;
}

.static-copy-btn:hover {
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.static-copy-btn:active {
  transform: scale(0.95);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .prompts-grid {
    grid-template-columns: 1fr;
  }
}

/* Additional Dark Mode Fixes for Prompts Visibility */
.prompts-page[data-theme="dark"] .content-area {
  background: rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.prompts-page[data-theme="dark"] .content-area * ,
.prompts-page[data-theme="dark"] .elementor * ,
.prompts-page[data-theme="dark"] .elementor-element * ,
.prompts-page[data-theme="dark"] .elementor-widget-container * ,
.prompts-page[data-theme="dark"] .elementor-section * ,
.prompts-page[data-theme="dark"] .elementor-column * ,
.prompts-page[data-theme="dark"] .elementor-column-wrap * ,
.prompts-page[data-theme="dark"] .elementor-container * ,
.prompts-page[data-theme="dark"] .elementor-inner * ,
.prompts-page[data-theme="dark"] .e-con-inner * ,
.prompts-page[data-theme="dark"] .elementor-widget-wrap * {
  color: #ffffff !important;
}

.prompts-page[data-theme="dark"] .content-area a:hover,
.prompts-page[data-theme="dark"] .elementor a:hover {
  color: #667eea !important;
}

.prompts-page[data-theme="dark"] .content-area table,
.prompts-page[data-theme="dark"] .content-area th,
.prompts-page[data-theme="dark"] .content-area td,
.prompts-page[data-theme="dark"] .content-area tbody,
.prompts-page[data-theme="dark"] .content-area thead {
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ===== MANAGEMENT PAGE THEME PRESETS ===== */

/* Theme Preset Cards */
.theme-preset-card {
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid #e9ecef !important;
  background: white;
}

.theme-preset-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-color: #667eea !important;
}

.theme-preset-card.border-primary.bg-light {
  border-color: #667eea !important;
  background: #f8f9fa !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Color Dots */
.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
  display: inline-block;
}

/* ===== ACCOUNT PAGE STYLES ===== */

.profile-header-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 2rem;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 2rem;
}

.profile-avatar {
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    backdrop-filter: blur(10px);
}

.profile-name {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.profile-email {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.profile-meta .badge {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
}

.account-status {
    margin-top: 1rem;
}

.status-indicator.active {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #28a745;
    font-weight: 600;
    font-size: 1.1rem;
}

.status-indicator.active i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.stat-icon {
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item {
    margin-bottom: 1.5rem;
}

.info-item .form-label {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #495057;
}

.info-item i {
    width: 20px;
}

@media (max-width: 768px) {
    .profile-header-card {
        padding: 1.5rem;
    }

    .profile-name {
        font-size: 2rem;
    }

    .profile-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .profile-meta .badge {
        display: block;
        text-align: center;
    }

    .stat-card {
        margin-bottom: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }
}

/* ===== STANDARDIZED PAGE HEADER STYLES ===== */

/* Standardized page header container */
.page-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0;
    gap: 1rem;
}

.page-header-container .page-header-main {
    display: flex;
    align-items: center;
    flex: 1;
}

.page-header-icon {
    font-size: 2rem;
    margin-right: 1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.page-header-content {
    flex: 1;
    min-width: 0; /* Prevents flex item overflow */
}

.page-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    color: var(--text-primary, #1a202c);
}

.page-header-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted, #6c757d);
    margin-bottom: 0;
    line-height: 1.4;
}

.page-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 16px;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    color: #4a5568;
    transition: all 0.3s ease;
}

.page-header-badge i {
    font-size: 0.875rem;
}

/* Responsive adjustments for page headers */
@media (max-width: 768px) {
    .page-header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .page-header-main {
        width: 100%;
    }

    .page-header-icon {
        font-size: 1.5rem;
        margin-right: 1rem;
    }

    .page-header-title {
        font-size: 1.25rem;
        margin-bottom: 0.125rem;
    }

    .page-header-subtitle {
        font-size: 0.8rem;
        margin-bottom: 0;
    }

    .page-header-badge {
        align-self: flex-end;
        margin-top: 0.125rem;
    }
}

@media (max-width: 576px) {
    .page-header-container {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .page-header-icon {
        font-size: 1.25rem;
        margin-right: 0.75rem;
    }

    .page-header-title {
        font-size: 1.125rem;
    }

    .page-header-subtitle {
        font-size: 0.75rem;
    }

    .page-header-badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
        align-self: flex-end;
        margin-top: 0;
    }
}

/* ===== MOBILE HEADER OPTIMIZATION ===== */

/* Mobile-specific header styles to reduce space usage */
@media (max-width: 768px) {
    /* Reduce header spacing on mobile - optimized for better space usage */
    .d-flex.align-items-center.justify-content-between.mb-3 {
        margin-bottom: 0.5rem !important; /* Reduced from 1rem to 0.5rem (8px) */
        padding: 0.25rem 0; /* Reduced from 0.5rem to 0.25rem (4px) */
    }

    /* Make the icon smaller on mobile */
    .d-flex.align-items-center.justify-content-between.mb-3 .fa-2x {
        font-size: 1.5rem !important; /* Reduced from 2x to 1.5x */
    }

    /* Reduce text sizes on mobile */
    .d-flex.align-items-center.justify-content-between.mb-3 .h2 {
        font-size: 1.25rem !important; /* Reduced from 1.5rem */
        margin-bottom: 0.125rem !important; /* Reduced from 0.25rem */
    }

    .d-flex.align-items-center.justify-content-between.mb-3 .text-muted {
        font-size: 0.875rem !important; /* Reduced from 1rem */
        margin-bottom: 0 !important;
    }

    /* Make the badge more compact on mobile */
    .d-flex.align-items-center.justify-content-between.mb-3 .badge {
        font-size: 0.75rem !important; /* Reduced from 0.875rem */
        padding: 0.375rem 0.75rem !important; /* Reduced padding */
        border-radius: 16px !important;
    }

    /* Reduce icon margin on mobile */
    .d-flex.align-items-center.justify-content-between.mb-3 .me-3 {
        margin-right: 1rem !important; /* Reduced from 1.5rem */
    }

    /* Stack elements vertically on very small screens - optimized spacing */
    @media (max-width: 576px) {
        .d-flex.align-items-center.justify-content-between.mb-3 {
            flex-direction: column;
            align-items: flex-start !important;
            gap: 0.25rem; /* Reduced from 0.5rem */
            margin-bottom: 0.25rem !important; /* Reduced from 1rem to 0.25rem (4px) */
            padding: 0; /* Removed padding entirely for maximum space efficiency */
        }

        /* Stack the badge below the text on very small screens */
        .d-flex.align-items-center.justify-content-between.mb-3 .d-flex.align-items-center:last-child {
            align-self: flex-end;
            margin-top: 0.125rem; /* Reduced from 0.25rem */
        }

        /* Further reduce icon size on very small screens */
        .d-flex.align-items-center.justify-content-between.mb-3 .fa-2x {
            font-size: 1.25rem !important;
        }

        /* Reduce text sizes further on very small screens */
        .d-flex.align-items-center.justify-content-between.mb-3 .h2 {
            font-size: 1.125rem !important;
        }

        .d-flex.align-items-center.justify-content-between.mb-3 .text-muted {
            font-size: 0.8rem !important;
        }
    }
}
