/* --- Modern Tabbed Settings Layout --- */

.settings-container-modern {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    min-height: 700px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

/* Sidebar Nav */
.settings-sidebar-nav {
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border-color);
    padding: 40px 20px;
    /* Removed display:flex to rely on block layout inside grid item */
}

.sidebar-header-brief h2 {
    font-size: 1.4em;
    font-weight: 800;
    margin-bottom: 30px;
    padding-left: 15px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.settings-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-tab-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    border-radius: 14px;
    color: var(--text-color-muted);
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
}

.settings-tab-btn i {
    font-size: 1.1em;
    width: 20px;
    text-align: center;
}

.settings-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}

.settings-tab-btn.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 8px 20px rgba(140, 82, 255, 0.3);
}

/* Content Area */
.settings-content-area {
    padding: 50px 60px;
    position: relative;
    min-height: 500px;
}

/* Responsive Behavior - Tablet/Mobile */
@media (max-width: 900px) {
    .settings-container-modern {
        grid-template-columns: 1fr;
        border-radius: 20px;
        border: 1px solid var(--border-color);
        display: flex;
        flex-direction: column;
    }

    .settings-sidebar-nav {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 20px 20px 10px;
        width: 100%;
    }

    .sidebar-header-brief,
    .sidebar-header-brief h2 {
        display: none;
    }

    .settings-tabs {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        gap: 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        width: 100%;
        justify-content: flex-start;
    }

    .settings-tabs::-webkit-scrollbar {
        display: none;
    }

    .settings-tab-btn {
        white-space: nowrap;
        padding: 10px 15px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 10px;
        width: auto !important;
        /* Force auto width on mobile */
        flex-shrink: 0;
    }

    .settings-content-area {
        padding: 30px 20px;
    }
}

.settings-section {
    display: none;
    animation: fadeInTab 0.4s ease forwards;
}

.settings-section.active {
    display: block;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header-modern {
    margin-bottom: 40px;
}

.section-header-modern h2 {
    font-size: 2em;
    font-weight: 800;
    margin-bottom: 8px;
}

.section-header-modern p {
    color: var(--text-color-muted);
    font-size: 1em;
}

/* Refined Cards & Forms */
.settings-card-refined {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 35px;
}

.form-group-refined {
    margin-bottom: 30px;
}

.form-group-refined label {
    display: block;
    font-weight: 700;
    font-size: 0.95em;
    margin-bottom: 12px;
    color: var(--text-color);
}

.settings-input-refined {
    width: 100%;
    background: var(--input-bg-color);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: 14px;
    color: var(--text-color);
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
}

.settings-input-refined.mini {
    width: 60px;
    text-align: center;
}

.settings-input-refined:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(140, 82, 255, 0.1);
}

.input-hint {
    display: block;
    font-size: 0.8em;
    color: var(--text-color-muted);
    margin-top: 8px;
    opacity: 0.7;
}

/* Buttons */
.primary-action-btn {
    background: var(--accent-color);
    color: white;
    padding: 16px 32px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 1em;
    transition: all 0.3s ease;
    width: 100%;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.primary-action-btn:hover {
    background: var(--accent-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(140, 82, 255, 0.4);
}

.secondary-action-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    padding: 16px 32px;
    border-radius: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
    width: 100%;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-family: inherit;
}

.secondary-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Personalization Grids */
.theme-toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.theme-choice-btn {
    background: var(--input-bg-color);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 14px;
    color: var(--text-color-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: inherit;
}

.theme-choice-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

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

.accent-color-grid-refined {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.active {
    border-color: white;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.color-swatch.active::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.8em;
}

.status-msg {
    margin-top: 20px;
    font-weight: 600;
    font-size: 0.9em;
    padding: 12px;
    border-radius: 10px;
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Stealth Refined */
.stealth-grid-refined {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
}

.stealth-choice-btn {
    background: var(--input-bg-color);
    border: 1px solid var(--border-color);
    padding: 20px 10px;
    border-radius: 16px;
    color: var(--text-color-muted);
    font-weight: 700;
    font-size: 0.85em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: inherit;
}

.stealth-choice-btn i {
    font-size: 1.5em;
}

.stealth-choice-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 8px 20px rgba(140, 82, 255, 0.2);
}

.panic-setup-grid {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.input-with-label span {
    display: block;
    font-size: 0.8em;
    font-weight: 700;
    margin-bottom: 6px;
    opacity: 0.6;
}

/* Achievements Premium */
.badges-grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.badge-card-premium {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.badge-card-premium:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
    border-color: var(--accent-color);
}

.badge-icon-wrapper {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover-color));
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6em;
    color: white;
    box-shadow: 0 10px 20px rgba(140, 82, 255, 0.2);
}

.badge-info-refined {
    flex: 1;
}

.badge-name {
    display: block;
    font-weight: 800;
    font-size: 1.1em;
    margin-bottom: 4px;
}

.badge-desc-refined {
    display: block;
    font-size: 0.85em;
    color: var(--text-color-muted);
}

.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-color-muted);
    font-style: italic;
    padding: 20px;
}