/**
 * Theme Variables — Dark Default
 * ================================
 * Dark navy is the ONLY supported theme for the frontend.
 * No [data-theme="light"] blocks — dark is enforced globally
 * regardless of what the HTML data-theme attribute says.
 *
 * Aesthetic: ContentFlows — dark navy + hot-pink (OnlyFans/Fansly/Fanvue).
 */

/* ─────────────────────────────────────────────
   :root — Global dark defaults (no attribute required)
   ───────────────────────────────────────────── */
:root {
    /* Legacy aliases */
    --primary:            var(--color-primary, #e91e8c);
    --primary-hover:      var(--color-primary-hover, #c91779);
    --primary-muted:      var(--color-primary-muted, rgba(233,30,140,0.12));
    --secondary:          var(--color-secondary, #7c3aed);
    --accent:             var(--color-primary, #e91e8c);
    --success:            var(--color-success, #10b981);
    --warning:            var(--color-warning, #f59e0b);
    --danger:             var(--color-danger, #ef4444);
    --info:               var(--color-info, #3b82f6);

    --sidebar-width:      260px;
    --transition-speed:   200ms;
    --transition-ease:    cubic-bezier(0.4, 0, 0.2, 1);

    /* Dark backgrounds — always */
    --body-bg:            #0c0c1e;
    --card-bg:            #141430;
    --sidebar-bg:         #0a0a1a;
    --secondary-bg:       #111128;
    --tertiary-bg:        #1a1a36;
    --input-bg:           #1a1a30;

    /* Light text — always */
    --text-color:         #f0f0fa;
    --text-muted:         #8888aa;
    --sidebar-text:       #c4c4e0;

    /* Dark borders */
    --border-color:       rgba(255, 255, 255, 0.08);
    --input-border:       rgba(255, 255, 255, 0.12);
    --input-focus-border: #e91e8c;

    /* Sidebar states */
    --sidebar-active-bg:  rgba(233, 30, 140, 0.18);
    --sidebar-hover-bg:   rgba(233, 30, 140, 0.08);
    --sidebar-active-text:#e91e8c;

    /* Icon backgrounds */
    --icon-bg-pink:       rgba(233, 30, 140, 0.15);
    --icon-bg-purple:     rgba(124, 58, 237, 0.15);
    --icon-bg-blue:       rgba(59, 130, 246, 0.15);
    --icon-bg-teal:       rgba(20, 184, 166, 0.15);
}

/* ─────────────────────────────────────────────
   [data-theme="dark"] — explicit reinforcement
   (redundant with :root but explicit is clearer)
   ───────────────────────────────────────────── */
[data-theme="dark"] {
    --body-bg:            #0c0c1e;
    --card-bg:            #141430;
    --sidebar-bg:         #0a0a1a;
    --secondary-bg:       #111128;
    --tertiary-bg:        #1a1a36;
    --input-bg:           #1a1a30;
    --text-color:         #f0f0fa;
    --text-muted:         #8888aa;
    --sidebar-text:       #c4c4e0;
    --border-color:       rgba(255, 255, 255, 0.08);
    --input-border:       rgba(255, 255, 255, 0.12);
    --input-focus-border: #e91e8c;
    --sidebar-active-bg:  rgba(233, 30, 140, 0.18);
    --sidebar-hover-bg:   rgba(233, 30, 140, 0.08);
    --sidebar-active-text:#e91e8c;
    --icon-bg-pink:       rgba(233, 30, 140, 0.15);
    --icon-bg-purple:     rgba(124, 58, 237, 0.15);
    --icon-bg-blue:       rgba(59, 130, 246, 0.15);
    --icon-bg-teal:       rgba(20, 184, 166, 0.15);
}

/* ─────────────────────────────────────────────
   BODY — dark baseline (no attribute needed)
   ───────────────────────────────────────────── */
body {
    background-color: var(--body-bg, #0c0c1e);
    color:            var(--text-color, #f0f0fa);
    transition: background-color var(--transition-speed) var(--transition-ease),
                color            var(--transition-speed) var(--transition-ease);
}

/* ─────────────────────────────────────────────
   GLOBAL ELEMENT OVERRIDES — always dark
   These fire regardless of data-theme attribute.
   ───────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    color: var(--text-color, #f0f0fa);
}

p, span, li, td, th, dt, dd,
blockquote, cite, strong, em, b {
    color: var(--text-color, #f0f0fa);
}

/* Keep icon libraries unaffected */
i:not(.feather):not(.bi):not(.fas):not(.far):not(.fab):not(.fa):not(.fa-solid):not(.fa-regular) {
    color: var(--text-color, #f0f0fa);
}

label, legend {
    color: var(--text-color, #f0f0fa);
}

small, .text-muted, .text-secondary {
    color: var(--text-muted, #8888aa);
}

a {
    color: var(--primary, #e91e8c);
}

a:hover {
    color: var(--primary-hover, #f03ca0);
}

/* Navigation/button links keep their inherited color */
a.button,
a.button-primary,
a.button-secondary,
a.nav-link,
a.sidebar-brand-link,
a.user-name-link {
    color: inherit;
}

/* ── Forms — always dark inputs ── */
input,
textarea,
select {
    background-color: var(--input-bg, #1a1a30);
    border-color:     var(--input-border, rgba(255,255,255,0.12));
    color:            var(--text-color, #f0f0fa);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted, #8888aa);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--input-focus-border, #e91e8c);
    box-shadow: 0 0 0 3px rgba(233, 30, 140, 0.18);
    outline: none;
}

/* ── Cards / Panels — always dark ── */
.card,
.panel,
.box,
.modal-content,
.dropdown-menu {
    background-color: var(--card-bg, #141430);
    color:            var(--text-color, #f0f0fa);
    border-color:     var(--border-color, rgba(255,255,255,0.08));
}

/* ── Tables ── */
table, thead, tbody, tr, th {
    border-color: var(--border-color, rgba(255,255,255,0.08));
}

th {
    background-color: var(--secondary-bg, #111128);
}

/* ── HR ── */
hr {
    border-color: var(--border-color, rgba(255,255,255,0.08));
}

/* ── Code ── */
code, pre {
    background-color: var(--secondary-bg, #111128);
    color:            var(--text-color, #f0f0fa);
}

/* ── Alerts ── */
.alert-success, .message-success {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.25);
}

.alert-danger, .message-error {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.25);
}

.alert-warning, .message-warning {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.25);
}

.alert-info, .message-info {
    background: rgba(96, 165, 250, 0.12);
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.25);
}

/* ─────────────────────────────────────────────
   SIDEBAR — always dark
   ───────────────────────────────────────────── */
.frontend-sidebar,
.sidebar {
    background-color: var(--sidebar-bg, #0a0a1a);
    border-right: 1px solid var(--border-color, rgba(255,255,255,0.06));
}

.nav-link,
.sidebar-link {
    color: var(--sidebar-text, #c4c4e0);
}

.nav-link:hover,
.sidebar-link:hover {
    background-color: var(--sidebar-hover-bg, rgba(233,30,140,0.08));
    color: var(--text-color, #f0f0fa);
}

.nav-link.active,
.sidebar-link.active {
    background-color: var(--sidebar-active-bg, rgba(233,30,140,0.18));
    color: var(--sidebar-active-text, #e91e8c);
}

.nav-section-title {
    color: var(--text-muted, #8888aa);
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

/* ─────────────────────────────────────────────
   THEME TOGGLE BUTTON
   ───────────────────────────────────────────── */
.theme-toggle-container {
    position: fixed;
    top: 1rem;
    right: 60px;
    z-index: 999;
}

/* Hide theme toggle and language selector on Studio pages (they have their own header) */
body:has(.studio-page-header) .theme-toggle-container,
body:has(.studio-page-header) .language-selector,
body:has(.studio-page-title) .theme-toggle-container,
body:has(.studio-page-title) .language-selector,
body:has(.studio-sidebar) .theme-toggle-container,
body:has(.studio-sidebar) .language-selector {
    display: none;
}

.theme-toggle-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    background: var(--card-bg, #141430);
    color: var(--text-color, #f0f0fa);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 200ms ease;
    padding: 0;
}

.theme-toggle-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(233,30,140,0.3);
    border-color: #e91e8c;
}

.theme-toggle-button:focus {
    outline: 2px solid #e91e8c;
    outline-offset: 2px;
}

.theme-icon-sun  { display: block; }
.theme-icon-moon { display: none; }

/* ─────────────────────────────────────────────
   LANGUAGE SELECTOR
   ───────────────────────────────────────────── */
.language-selector {
    position: fixed;
    top: 1rem;
    right: 108px;
    z-index: 999;
    background: var(--card-bg, #141430);
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: var(--radius-lg, 12px);
    padding: 4px;
}

.language-selector select {
    background: transparent;
    border: none;
    color: var(--text-color, #f0f0fa);
    padding: 4px 10px;
    cursor: pointer;
    outline: none;
    font-size: 0.875rem;
}
