/* 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%);

  /* Background Colors */
  --bg-primary: #0f0f23;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #16213e;
  --bg-card: #222;
  --bg-input: #2d3748;

  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #a0aec0;

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

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);

  /* 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 */
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  background-image: radial-gradient(circle at 1px 1px, rgba(105, 105, 105, 0.15) 1px, transparent 0);
  background-size: 30px 30px;
}

/* Modern Card Design */
.modern-card {
  background: var(--bg-card);
  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;
}

.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;
}

.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: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.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  z-index: 10;
}

.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;
}

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

/* ===== LIGHT MODE STYLES ===== */
[data-theme="light"] body {
  background: linear-gradient(135deg, #e6e9f0 0%, #eef1f5 50%, #f3f6f9 100%) !important;
  color: #1a202c !important;
}

[data-theme="light"] {
  /* Light mode color variables */
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --bg-primary: #f7fafc;
  --bg-secondary: #edf2f7;
  --bg-card: #ffffff;
  --bg-input: #e2e8f0;
  --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: #1a202c !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-modern {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: #1a202c;
}

[data-theme="light"] .navbar-modern .nav-link,
[data-theme="light"] .brand-gradient {
  color: #1a202c !important;
}

[data-theme="light"] .custom-dropdown-menu {
  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"] .custom-dropdown-menu a,
[data-theme="light"] .custom-dropdown-menu a:hover,
[data-theme="light"] .custom-dropdown-menu a:active,
[data-theme="light"] .custom-dropdown-menu a:focus,
[data-theme="light"] .custom-dropdown-menu a:visited {
  color: #1a202c !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

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

[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"] .btn-primary-custom {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

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

[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;
}

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

/* Global Application Body Styling */
body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
  min-height: 100vh;
  margin: 0;
}

/* 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 */
h1 { font-size: 1.8rem; }
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.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:last-child {
  border-bottom: none;
}

.custom-dropdown-menu a:hover {
  background: linear-gradient(135deg, #667eea 0%, #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;
  }
}

/* ===== 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;
}
