/* ============================================
   1c. THEME TOGGLE COMPONENT
   ============================================ */
.theme-toggle {
    position: relative;
    width: 50px;
    height: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: var(--radius-full);
    transition: all var(--duration) var(--ease);
    flex-shrink: 0;
}

.theme-toggle-track {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-full);
    background: var(--surface-overlay);
    border: 1px solid var(--border-default);
    transition: background var(--duration) var(--ease),
                border-color var(--duration) var(--ease);
}

.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand);
    transition: transform var(--duration) var(--ease-spring),
                background var(--duration) var(--ease);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Thumb moves right when light theme is active */
.theme-toggle-thumb::before {
    content: '\f186';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    line-height: 1;
}

[data-theme="light"] .theme-toggle-thumb {
    transform: translateX(22px);
    background: var(--warning);
}

[data-theme="light"] .theme-toggle-thumb::before {
    content: '\f185';
}

[data-theme="light"] .theme-toggle-track {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
}

.theme-toggle:hover .theme-toggle-thumb {
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
    transform: scale(1.08);
}

[data-theme="light"] .theme-toggle:hover .theme-toggle-thumb {
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
    transform: translateX(22px) scale(1.08);
}

/* ============================================
   2. RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--surface-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

button {
    font-family: inherit;
}

/* Selection style */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

/* Smooth reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
