/* =========================================
   CMS BASE
   - Theme-Variablen (Dark/Light)
   - Global Reset & Body
   - Theme Toggle
========================================= */

/* ----- DARKMODE (Standard) ----- */
.cms-body {
    --accent-rgb: 250, 204, 21;
    --accent-soft: rgba(250, 204, 21, 0.2);

    --bg-body: #181818;
    --bg-surface: #212121;
    --bg-surface-alt: #2a2a2a;

    --header-bg: #212121;
    --header-text: #f1f1f1;

    --sidebar-bg: #212121;
    --sidebar-text: #bbbbbb;
    --sidebar-text-active: #ffffff;

    --text-color: #e5e5e5;
    --muted-text: #aaaaaa;

    --border-subtle: #333333;

    --shadow-soft: none;
}

/* ----- LIGHTMODE ----- */
.cms-body[data-theme="light"] {
    --bg-body: #ffffff;
    --bg-surface: #f9f9f9;
    --bg-surface-alt: #f1f1f1;

    --header-bg: #f1f1f1;
    --header-text: #111111;

    --sidebar-bg: #f1f1f1;
    --sidebar-text: #333333;
    --sidebar-text-active: #000000;

    --text-color: #111111;
    --muted-text: #666666;

    --border-subtle: #e5e5e5;

    --shadow-soft: none;
}

/* Theme-Toggle */
.cms-theme-toggle {
    position: relative;
    width: 70px;
    height: 26px;
    margin: 0 auto;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface-alt);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-color);
}

.cms-theme-toggle::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #ffffff;
    transition: left 0.18s ease;
}

.cms-body[data-theme="light"] .cms-theme-toggle::before {
    left: calc(100% - 27px);
}

.cms-theme-label {
    z-index: 1;
    opacity: 0.5;
    transition: opacity 0.18s ease;
}

.cms-theme-label-dark {
    margin-right: auto;
}

.cms-theme-label-light {
    margin-left: auto;
}

.cms-body[data-theme="dark"] .cms-theme-label-dark {
    opacity: 1;
}

.cms-body[data-theme="light"] .cms-theme-label-light {
    opacity: 1;
}

/* =========================================
   GLOBAL
========================================= */

* {
    box-sizing: border-box;
}

body.cms-body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-body);
    color: var(--text-color);
}

a {
    color: inherit;
    text-decoration: none;
}
