/* settings.css */

:root {
    --bg-primary: #1e1e2e;
    --bg-secondary: #252536;
    --bg-tertiary: #2d2d44;
    --text-primary: #cdd6f4;
    --text-secondary: #a6adc8;
    --accent-primary: #89b4fa;
    --accent-secondary: #cba6f7;
    --border-color: #45475a;
    --success: #a6e3a1;
    --warning: #f9e2af;
    --error: #f38ba8;
    --line-number: #6c7086;
    --autocomplete-bg: #313244;
    --autocomplete-hover: #45475a;
}

body.light-theme {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e9e9e9;
    --text-primary: #333333;
    --text-secondary: #666666;
    --accent-primary: #4285f4;
    --accent-secondary: #9b72cb;
    --border-color: #dddddd;
    --success: #34a853;
    --warning: #fbbc05;
    --error: #ea4335;
    --line-number: #999999;
    --autocomplete-bg: #ffffff;
    --autocomplete-hover: #f0f0f0;
}

/* Ensure settings content area takes available space */
.settings-content {
    flex: 1;
    padding: 1.5rem;
    background-color: var(--bg-primary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    overflow-y: auto;
    height: 100%; /* Takes remaining height */
    box-sizing: border-box; /* Include padding/border in height */
}

.settings-content h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--accent-primary);
    font-weight: 600;
}

.settings-content p,
.settings-content ul,
.settings-content pre {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.settings-content a {
    color: var(--accent-secondary);
    text-decoration: none;
}

.settings-content a:hover {
    text-decoration: underline;
}

.settings-content pre {
    background-color: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Google Sans Code', monospace;
    font-size: 0.9em;
    border: 1px solid var(--border-color);
    white-space: pre-wrap; /* Wrap long lines */
}

.settings-content code {
    display: block;
}

.status-beta {
    background-color: var(--warning); /* Yellow for beta */
    color: var(--bg-primary);
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-weight: bold;
}


/* --- Settings Sidebar Navigation Styles --- */
/* Style for the settings navigation inside the sidebar */
.settings-sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    flex-grow: 1; /* Allow it to take available space */
}

.close-btn {
    padding: 8px;
}

.settings-nav-btn { /* Renamed from tab-btn to avoid potential conflicts */
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Nata Sans', sans-serif;
    font-weight: 500;
    text-align: left;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Space between icon and text */
    width: 100%; /* Ensure full width for consistent hover */
    box-sizing: border-box; /* Include padding in width */
}

.settings-nav-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.settings-nav-btn.active {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
}

/* Ensure the sidebar version section stays at the bottom */
.sidebar-version {
    margin-top: auto; /* Pushes it down */
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* --- End of Settings Sidebar Navigation Styles --- */


/* --- Responsive Adjustments (if needed) --- */
/* You might need to adjust styles for smaller screens */
/* Example: Hide text labels on very small screens, keep icons */
@media (max-width: 500px) {
    .settings-nav-btn span { /* Wrap text in <span> if you want to hide it */
        display: none;
    }
    .settings-nav-btn {
        padding: 0.75rem;
    }
}

.header-left {
    padding-bottom: 10px;
}

.changelogs-content {
    padding: 2rem;
}

.settings-btn-sidebar {
    margin-bottom: 10px;
}

.sidebar-version {
    margin-bottom: -8px;
}

/* --- End of Responsive Adjustments --- */

/* Reduce header padding on settings page */
.main-content header {
    padding-bottom: 0.5rem;
}

/* --- Customisation Settings --- */
.setting-group {
    margin-bottom: 2rem;
}

.setting-group h3 {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.theme-buttons {
    display: flex;
    gap: 1rem;
}

.theme-btn {
    flex-grow: 1;
}

.theme-btn.active {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

/* Custom Dropdown for Fonts */
.custom-dropdown {
    position: relative;
    width: 100%;
    max-width: 400px; /* Or whatever width you prefer */
}

.dropdown-toggle {
    width: 100%;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Nata Sans', sans-serif;
    font-size: 1rem;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-toggle:hover {
    background-color: var(--bg-secondary);
}

.dropdown-toggle:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-primary-translucent, rgba(137, 180, 250, 0.3));
}

.dropdown-toggle .fa-chevron-down {
    transition: transform 0.2s ease;
}

.custom-dropdown.open .dropdown-toggle .fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    list-style: none;
    margin-top: 0.25rem;
    padding: 0.5rem 0;
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
}

.custom-dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: var(--text-primary);
}

.dropdown-menu li:hover {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
}

.dropdown-menu li.selected {
    background-color: var(--accent-primary-translucent, rgba(137, 180, 250, 0.2));
    color: var(--accent-primary);
    font-weight: 500;
}

/* Font Preview */
.font-preview-container {
    margin-top: 1rem;
}

#font-preview-code {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre;
    overflow-x: auto;
    transition: font-family 0.2s ease; /* Smooth font transition */
}

/* Syntax Highlighting Tokens */
#font-preview-code .token.keyword { color: #cba6f7; }
#font-preview-code .token.class-name { color: #f9e2af; }
#font-preview-code .token.function { color: #89b4fa; }
#font-preview-code .token.string { color: #a6e3a1; }
#font-preview-code .token.comment { color: #6c7086; }
#font-preview-code .token.parameter { color: #f38ba8; }

/* Light Theme Overrides */
body.light-theme #font-preview-code .token.keyword { color: #7e57c2; }
body.light-theme #font-preview-code .token.class-name { color: #c49000; }
body.light-theme #font-preview-code .token.function { color: #4285f4; }
body.light-theme #font-preview-code .token.string { color: #34a853; }
body.light-theme #font-preview-code .token.comment { color: #6a737d; }
body.light-theme #font-preview-code .token.parameter { color: #d81b60; }