/* Light mode (default) */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-navbar: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-input: #ffffff;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-input: #1e293b;

    --border-color: #e2e8f0;
    --border-focus: #2563eb;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Dark mode */
.dark {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #a78bfa;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;

    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-navbar: #1e293b;
    --bg-sidebar: #1e293b;
    --bg-input: #334155;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-input: #f1f5f9;

    --border-color: #475569;
    --border-focus: #3b82f6;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* Apply variables to elements */
body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navbar */
.navbar {
    background-color: var(--bg-navbar);
    border-bottom: 1px solid var(--border-color);
}

/* Cards */
.bg-white, .card {
    background-color: var(--bg-card) !important;
}

/* Text colors */
.text-gray-900, .text-gray-800 {
    color: var(--text-primary) !important;
}

.text-gray-600, .text-gray-500, .text-slate-600, .text-slate-500 {
    color: var(--text-secondary) !important;
}

.text-gray-700, .text-slate-700 {
    color: var(--text-primary) !important;
}

/* Border colors */
.border, .border-gray-200, .border-gray-300, .border-slate-200, .border-slate-300 {
    border-color: var(--border-color) !important;
}

/* ========== INPUT FIELDS - FIXED CONTRAST ========== */
input,
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
textarea,
select {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-input) !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.5rem !important;
    transition: all 0.3s ease !important;
}

/* Light mode input specific */
input, .input {
    background-color: #ffffff !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
}

/* Dark mode input specific */
.dark input,
.dark .input,
.dark input[type="text"],
.dark input[type="email"],
.dark input[type="password"],
.dark input[type="tel"],
.dark textarea,
.dark select {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

/* Input focus */
input:focus, .input:focus {
    outline: none !important;
    border-color: var(--border-focus) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    ring: 2px solid var(--border-focus) !important;
}

/* Placeholder text */
input::placeholder, .input::placeholder {
    color: #94a3b8 !important;
    opacity: 0.7 !important;
}

.dark input::placeholder,
.dark .input::placeholder {
    color: #64748b !important;
    opacity: 0.8 !important;
}

/* Disabled inputs */
input:disabled, .input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Readonly inputs */
input:read-only, .input:read-only {
    background-color: var(--bg-sidebar) !important;
}

/* Label styling */
label {
    color: var(--text-secondary) !important;
    font-weight: 500 !important;
    margin-bottom: 0.25rem !important;
    display: inline-block !important;
}

.dark label {
    color: #cbd5e1 !important;
}

/* ========== END INPUT FIXES ========== */

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Sidebar */
.sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
}

/* Tables */
table {
    background-color: var(--bg-card);
}

thead tr, .bg-gray-50 {
    background-color: var(--bg-sidebar) !important;
}

tbody tr {
    border-bottom-color: var(--border-color) !important;
}

tbody tr:hover {
    background-color: var(--bg-input) !important;
}

/* Modals */
.modal-content {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

/* Dropdowns */
.dropdown-menu {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

/* Footer */
footer {
    background-color: #0f172a !important;
}

.dark footer {
    background-color: #0a0f1a !important;
}

/* Additional utility classes for dark mode */
.dark .bg-gray-50 { background-color: #1e293b !important; }
.dark .bg-gray-100 { background-color: #334155 !important; }
.dark .bg-white { background-color: #1e293b !important; }
.dark .bg-slate-50 { background-color: #0f172a !important; }
.dark .bg-slate-100 { background-color: #1e293b !important; }

.dark .text-gray-500, .dark .text-gray-600 { color: #94a3b8 !important; }
.dark .text-gray-700, .dark .text-gray-800, .dark .text-gray-900 { color: #f1f5f9 !important; }
.dark .text-slate-600, .dark .text-slate-500 { color: #94a3b8 !important; }
.dark .text-slate-700, .dark .text-slate-800, .dark .text-slate-900 { color: #f1f5f9 !important; }

.dark .border-gray-200, .dark .border-gray-300 { border-color: #334155 !important; }
.dark .border-slate-200, .dark .border-slate-300 { border-color: #334155 !important; }

.dark .hover\:bg-gray-50:hover { background-color: #334155 !important; }
.dark .hover\:bg-slate-50:hover { background-color: #334155 !important; }
.dark .hover\:bg-gray-100:hover { background-color: #334155 !important; }

/* Step indicators */
.dark .step.pending {
    background-color: #334155;
    color: #94a3b8;
}

/* Modal backdrop */
.modal-overlay {
    background-color: rgba(0, 0, 0, 0.5);
}

/* RTL support */
[dir="rtl"] .ml-2, [dir="rtl"] .ml-3, [dir="rtl"] .ml-4 {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .mr-2, [dir="rtl"] .mr-3, [dir="rtl"] .mr-4 {
    margin-right: 0;
    margin-left: auto;
}

[dir="rtl"] .space-x-2 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1;
}

[dir="rtl"] .text-left {
    text-align: right;
}

[dir="rtl"] .text-right {
    text-align: left;
}

[dir="rtl"] .flex-row {
    flex-direction: row-reverse;
}

/* Experimental Badge */
.experimental-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background-color: #f59e0b;
    color: #000000;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    margin-left: 0.5rem;
    vertical-align: middle;
    animation: pulse 2s infinite;
    text :"asd";
}

.dark .experimental-badge {
    background-color: #fbbf24;
    color: #000000;
}

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

/* Badge in navbar */
.navbar .experimental-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
}
