/* PassVault Custom Stylesheet & Theme System */

/* --- Base Body & Theme Transitions --- */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Light Mode Base Overrides */
html:not(.dark) body {
    background-color: #f8fafc;
    color: #0f172a;
}

/* --- Light Mode Specific Color Mapping --- */
html:not(.dark) .bg-slate-800\/90,
html:not(.dark) .bg-slate-800\/60,
html:not(.dark) .bg-slate-800\/40 {
    background-color: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
}

html:not(.dark) .bg-slate-900,
html:not(.dark) .bg-slate-900\/90,
html:not(.dark) .bg-slate-900\/80,
html:not(.dark) .bg-slate-900\/60 {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

html:not(.dark) .border-slate-700\/80,
html:not(.dark) .border-slate-700\/60,
html:not(.dark) .border-slate-700\/50,
html:not(.dark) .border-slate-700 {
    border-color: #e2e8f0;
}

/* Text Colors in Light Mode */
html:not(.dark) h1 {
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

html:not(.dark) .text-slate-200 {
    color: #0f172a;
}

html:not(.dark) .text-slate-300 {
    color: #334155;
}

html:not(.dark) .text-slate-400 {
    color: #64748b;
}

html:not(.dark) .text-slate-500 {
    color: #64748b;
}

/* Password Outputs & Accent Colors in Light Mode */
html:not(.dark) #passwordOutput,
html:not(.dark) #passphraseOutput,
html:not(.dark) #bulkOutput {
    color: #0284c7; /* High contrast cyan-600 */
}

html:not(.dark) #lengthNumber,
html:not(.dark) #wordCountValue {
    color: #0284c7;
    background-color: #ffffff;
    border-color: #cbd5e1;
}

/* Tab Styling */
.tab-btn.active-tab {
    background: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
    color: #ffffff !important;
    box-shadow: 0 4px 14px 0 rgba(2, 132, 199, 0.35);
}

html:not(.dark) .tab-btn:not(.active-tab) {
    color: #64748b;
}

html:not(.dark) .tab-btn:not(.active-tab):hover {
    color: #0f172a;
}

/* Buttons in Light Mode */
html:not(.dark) .bg-slate-700\/80,
html:not(.dark) #refreshBtn,
html:not(.dark) #refreshPassphraseBtn,
html:not(.dark) #themeToggleBtn,
html:not(.dark) #generateBulkBtn,
html:not(.dark) #copyBulkBtn {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

html:not(.dark) #refreshBtn:hover,
html:not(.dark) #refreshPassphraseBtn:hover,
html:not(.dark) #themeToggleBtn:hover,
html:not(.dark) #generateBulkBtn:hover,
html:not(.dark) #copyBulkBtn:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

/* Custom Checkbox Styling */
.custom-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    padding: 0.5rem;
    border-radius: 0.75rem;
    transition: background-color 0.2s ease;
}

.custom-checkbox-label:hover {
    background-color: rgba(148, 163, 184, 0.12);
}

.checkbox-box {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 0.375rem;
    border: 2px solid #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: transparent;
}

html:not(.dark) .checkbox-box {
    border-color: #94a3b8;
}

.custom-checkbox-input:checked + .checkbox-box {
    background: linear-gradient(135deg, #0284c7 0%, #3b82f6 100%);
    border-color: #0284c7;
    color: #ffffff;
}

/* Strength Meter Unfilled Bar in Light Mode */
html:not(.dark) .bg-slate-700 {
    background-color: #cbd5e1;
}

html:not(.dark) .bg-slate-900\/80 {
    background-color: #e2e8f0;
}

/* History Items in Light Mode */
html:not(.dark) .history-item {
    background-color: #f8fafc;
    border-color: #e2e8f0;
}

html:not(.dark) .history-item span {
    color: #1e293b;
}

html:not(.dark) .history-item:hover {
    border-color: #0284c7;
    background-color: #ffffff;
}

/* Select Inputs in Light Mode */
html:not(.dark) select {
    background-color: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

/* Textarea in Light Mode */
html:not(.dark) textarea {
    background-color: #ffffff;
    border-color: #cbd5e1;
}

/* Toast in Light Mode */
html:not(.dark) #toast {
    background-color: #ffffff;
    border-color: #0284c7;
    color: #0f172a;
}

/* Custom Range Slider */
.custom-range {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 9999px;
    background: #334155;
    outline: none;
}

html:not(.dark) .custom-range {
    background: #cbd5e1;
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0284c7;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.4);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.custom-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: #38bdf8;
}

.custom-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0284c7;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.4);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.custom-range::-moz-range-thumb:hover {
    transform: scale(1.15);
    background: #38bdf8;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}
