/* Alert Boxes */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 1px solid;
}

.alert-success {
    background-color: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

[data-theme="dark"] .alert-success {
    background-color: #14532d;
    border-color: #166534;
    color: #86efac;
}

.alert-warning {
    background-color: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

[data-theme="dark"] .alert-warning {
    background-color: #78350f;
    border-color: #92400e;
    color: #fde68a;
}

.alert-error {
    background-color: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

[data-theme="dark"] .alert-error {
    background-color: #7f1d1d;
    border-color: #991b1b;
    color: #fca5a5;
}

.alert-info-box {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 0.25rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

/* Preview boxes */
.preview-box {
    padding: 0.75rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: monospace;
    font-size: 0.9rem;
}

/* Force dark mode on all form elements - Override inline styles */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] code {
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
    border-color: var(--border-color) !important;
}

/* Preview boxes in dark mode */
[data-theme="dark"] .preview-box,
[data-theme="dark"] [style*="background: #f9fafb"],
[data-theme="dark"] [style*="background: #f3f4f6"],
[data-theme="dark"] [style*="background: white"] {
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
}

/* Override ALL hardcoded backgrounds in dark mode */
[data-theme="dark"] [style*="background: #f9fafb"],
[data-theme="dark"] [style*="background: #f3f4f6"],
[data-theme="dark"] [style*="background: #eff6ff"],
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:#f9fafb"],
[data-theme="dark"] [style*="background:#f3f4f6"],
[data-theme="dark"] [style*="background:#eff6ff"],
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background-color: #f9fafb"],
[data-theme="dark"] [style*="background-color: #f3f4f6"],
[data-theme="dark"] [style*="background-color: #eff6ff"],
[data-theme="dark"] [style*="background-color: white"],
[data-theme="dark"] [style*="background-color:#f9fafb"],
[data-theme="dark"] [style*="background-color:#f3f4f6"],
[data-theme="dark"] [style*="background-color:#eff6ff"],
[data-theme="dark"] [style*="background-color:white"],
[data-theme="dark"] [style*="background-color: #ffffff"],
[data-theme="dark"] [style*="background-color:#ffffff"],
[data-theme="dark"] [style*="background: #ffffff"],
[data-theme="dark"] [style*="background:#ffffff"] {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
}

/* Override hardcoded text colors in dark mode */
[data-theme="dark"] [style*="color: #78350f"],
[data-theme="dark"] [style*="color:#78350f"],
[data-theme="dark"] [style*="color: #92400e"],
[data-theme="dark"] [style*="color:#92400e"],
[data-theme="dark"] [style*="color: #1e40af"],
[data-theme="dark"] [style*="color:#1e40af"] {
    color: var(--primary) !important;
}

/* Specific overrides for common patterns */
[data-theme="dark"] .card [style*="background"] {
    background-color: var(--bg-color) !important;
}

[data-theme="dark"] div[style*="padding"][style*="background: white"],
[data-theme="dark"] div[style*="padding"][style*="background:white"],
[data-theme="dark"] div[style*="padding"][style*="background-color: white"],
[data-theme="dark"] div[style*="padding"][style*="background-color:white"] {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
}

/* Badge/Label Overrides for Dark Mode */
[data-theme="dark"] span[style*="background: #dcfce7"],
[data-theme="dark"] span[style*="background:#dcfce7"] {
    background-color: #14532d !important;
    color: #86efac !important;
}

[data-theme="dark"] span[style*="background: #fef3c7"],
[data-theme="dark"] span[style*="background:#fef3c7"] {
    background-color: #78350f !important;
    color: #fde68a !important;
}

[data-theme="dark"] span[style*="background: #fee2e2"],
[data-theme="dark"] span[style*="background:#fee2e2"] {
    background-color: #7f1d1d !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] span[style*="background: #f3f4f6"],
[data-theme="dark"] span[style*="background:#f3f4f6"] {
    background-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] span[style*="background: #dbeafe"],
[data-theme="dark"] span[style*="background:#dbeafe"] {
    background-color: #1e3a8a !important;
    color: #93c5fd !important;
}

/* Code blocks in tables */
[data-theme="dark"] code[style*="background: #f3f4f6"],
[data-theme="dark"] code[style*="background:#f3f4f6"] {
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--border-color) !important;
}

/* Additional Status Badge Colors for Dark Mode */
[data-theme="dark"] span[style*="background: #ef4444"],
[data-theme="dark"] span[style*="background:#ef4444"],
[data-theme="dark"] span[style*="background: #dc2626"],
[data-theme="dark"] span[style*="background:#dc2626"] {
    background-color: #7f1d1d !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] span[style*="background: #10b981"],
[data-theme="dark"] span[style*="background:#10b981"],
[data-theme="dark"] span[style*="background: #059669"],
[data-theme="dark"] span[style*="background:#059669"] {
    background-color: #14532d !important;
    color: #86efac !important;
}

[data-theme="dark"] span[style*="background: #f59e0b"],
[data-theme="dark"] span[style*="background:#f59e0b"],
[data-theme="dark"] span[style*="background: #d97706"],
[data-theme="dark"] span[style*="background:#d97706"] {
    background-color: #78350f !important;
    color: #fde68a !important;
}

[data-theme="dark"] span[style*="background: #3b82f6"],
[data-theme="dark"] span[style*="background:#3b82f6"],
[data-theme="dark"] span[style*="background: #2563eb"],
[data-theme="dark"] span[style*="background:#2563eb"] {
    background-color: #1e3a8a !important;
    color: #93c5fd !important;
}

/* Status badges with specific text colors */
[data-theme="dark"] span[style*="color: #dc2626"],
[data-theme="dark"] span[style*="color:#dc2626"],
[data-theme="dark"] span[style*="color: #991b1b"],
[data-theme="dark"] span[style*="color:#991b1b"] {
    color: #fca5a5 !important;
}

[data-theme="dark"] span[style*="color: #166534"],
[data-theme="dark"] span[style*="color:#166534"],
[data-theme="dark"] span[style*="color: #15803d"],
[data-theme="dark"] span[style*="color:#15803d"] {
    color: #86efac !important;
}

/* Labels and badges - general override */
[data-theme="dark"] .badge,
[data-theme="dark"] .label,
[data-theme="dark"] .tag {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--border-color) !important;
}