/* ================================================ */
/* ==  Frontend Theme-Adaptive Styles            == */
/* ================================================ */

/* CSS Variables for Light and Dark Themes */
:root {
    /* Light theme colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --primary-color: #3d5d95;
    --danger-color: #dc2626;
    --card-bg: #ffffff;
    --body-bg: #f9fafb;
    --border-color: #e5e7eb;
    --transition-normal: all 0.3s ease;
}

/* Dark theme colors */
[data-theme="dark"] {
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --primary-color: #6366f1;
    --danger-color: #ef4444;
    --card-bg: #1f2937;
    --body-bg: #111827;
    --border-color: #374151;
}

/* ================================================ */
/* ==  Theme-Adaptive Label Classes               == */
/* ================================================ */

/* Base label styles that adapt to theme */
.form-label,
.label-adaptive {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary) !important;
    margin-bottom: 0.5rem;
    transition: color var(--transition-normal);
}

.form-label.required::after,
.label-adaptive.required::after {
    content: ' *';
    color: var(--danger-color);
}

/* Small label variant */
.form-label-sm,
.label-adaptive-sm {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary) !important;
    margin-bottom: 0.375rem;
    transition: color var(--transition-normal);
}

/* Medium label variant */
.form-label-md,
.label-adaptive-md {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary) !important;
    margin-bottom: 0.5rem;
    transition: color var(--transition-normal);
}

/* Large label variant */
.form-label-lg,
.label-adaptive-lg {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary) !important;
    margin-bottom: 0.75rem;
    transition: color var(--transition-normal);
}

/* Semibold label variant */
.form-label-semibold,
.label-adaptive-semibold {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary) !important;
    margin-bottom: 0.5rem;
    transition: color var(--transition-normal);
}

/* Primary colored labels */
.form-label-primary,
.label-adaptive-primary {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color) !important;
    margin-bottom: 0.5rem;
    transition: color var(--transition-normal);
}

/* Muted label variant */
.form-label-muted,
.label-adaptive-muted {
    display: block;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-muted) !important;
    margin-bottom: 0.5rem;
    transition: color var(--transition-normal);
}

/* ================================================ */
/* ==  Override Tailwind Classes                 == */
/* ================================================ */

/* Override common Tailwind text color classes with theme-adaptive versions */
.text-gray-700-adaptive {
    color: var(--text-primary) !important;
    transition: color var(--transition-normal);
}

.text-gray-600-adaptive {
    color: var(--text-secondary) !important;
    transition: color var(--transition-normal);
}

.text-gray-500-adaptive {
    color: var(--text-muted) !important;
    transition: color var(--transition-normal);
}

/* ================================================ */
/* ==  Form Input Styles                         == */
/* ================================================ */

/* Theme-adaptive form inputs */
.form-input-adaptive {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    transition: background-color var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal);
}

.form-input-adaptive:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(61, 93, 149, 0.1) !important;
}

[data-theme="dark"] .form-input-adaptive:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

/* ================================================ */
/* ==  Theme Toggle Support                      == */
/* ================================================ */

/* Ensure smooth transitions when theme changes */
* {
    transition: background-color var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal);
}

/* Theme toggle button (if needed) */
.theme-toggle {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.theme-toggle:hover {
    background: var(--body-bg);
}