/* Theme Toggle Styles for CosmicCMS */

/* Root variables for dark mode (default) */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: #333333;
    --accent-color: #6366f1;
}

/* Light mode colors */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #0a0a0a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --accent-color: #4f46e5;
}

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

/* Theme toggle button */
.theme-toggle {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    width: 60px;
    height: 32px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    padding: 0;
    outline: none;
}

.theme-toggle:hover {
    border-color: var(--accent-color);
}

.theme-toggle:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.theme-toggle-slider {
    position: absolute;
    top: 3px;
    left: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-color);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Move slider to the right in light mode */
[data-theme="light"] .theme-toggle-slider {
    transform: translateX(26px);
}

/* Apply theme to common CosmicCMS elements */
/* Adjust these selectors to match your actual CosmicCMS structure */
.navbar,
.header {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card,
.panel,
.widget {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    transition: all 0.3s ease;
}

.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

/* Input fields */
input,
textarea,
select {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
    transition: all 0.3s ease;
}

/* Buttons */
.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Links */
a {
    color: var(--accent-color);
}

/* Code blocks */
pre,
code {
    background-color: var(--bg-primary);
    border-color: var(--border-color);
}