/* ══════════════════════════════════════════════
   SETTINGS — Senior-friendly settings UI
   Large touch targets, 16px inputs, teal accents
   ══════════════════════════════════════════════ */

.settings-module {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

.settings-title {
    font-size: 1.3rem;
    color: #2d3748;
    margin: 0 0 16px;
    font-weight: 700;
}

/* ─── Tab Navigation ─── */
.settings-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 20px;
    padding: 6px;
    background: #f7fafc;
    border-radius: 14px;
}

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

.settings-nav-btn {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #718096;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.settings-nav-btn:hover {
    background: rgba(91, 168, 160, 0.1);
    color: #2d3748;
}

.settings-nav-btn.active {
    background: #5BA8A0;
    color: white;
    box-shadow: 0 2px 8px rgba(91, 168, 160, 0.3);
}

/* ─── Settings Content ─── */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ─── Setting Group Card ─── */
.setting-group {
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.setting-group:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.setting-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.setting-group input[type="text"],
.setting-group input[type="number"],
.setting-group input[type="date"],
.setting-group input[type="email"],
.setting-group select,
.setting-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px; /* prevents iOS zoom */
    color: #2d3748;
    background: white;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.setting-group input:focus,
.setting-group select:focus,
.setting-group textarea:focus {
    border-color: #5BA8A0;
    outline: none;
    box-shadow: 0 0 0 3px rgba(91, 168, 160, 0.12);
}

.setting-group input[type="range"] {
    width: 100%;
    accent-color: #5BA8A0;
    height: 6px;
}

.setting-hint {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-top: 6px;
    line-height: 1.4;
}

/* ─── Toggle Switch (input + label pattern) ─── */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-switch label {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #cbd5e0;
    border-radius: 28px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch label::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + label {
    background: #5BA8A0;
}

.toggle-switch input:checked + label::after {
    transform: translateX(24px);
}

/* ─── Profile Preview ─── */
.profile-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #5BA8A0, #4A9690);
    border-radius: 16px;
    color: white;
    margin-bottom: 16px;
}

.preview-avatar {
    width: 56px;
    height: 56px;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    flex-shrink: 0;
}

.preview-name {
    font-size: 1.1rem;
    font-weight: 700;
}

/* ─── Avatar Picker ─── */
.avatar-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.avatar-option {
    width: 52px;
    height: 52px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-option:hover {
    border-color: #5BA8A0;
    transform: scale(1.1);
}

.avatar-option.selected {
    border-color: #5BA8A0;
    background: #f0fdfa;
    box-shadow: 0 0 0 3px rgba(91, 168, 160, 0.2);
}

/* ─── Theme Picker ─── */
.theme-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.theme-option {
    flex: 1;
    min-width: 100px;
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.theme-option:hover {
    border-color: #5BA8A0;
}

.theme-option.selected {
    border-color: #5BA8A0;
    background: #f0fdfa;
}

/* ─── Font Size Picker ─── */
.font-size-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.font-option {
    flex: 1;
    min-width: 60px;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    font-weight: 600;
}

.font-option.selected {
    border-color: #5BA8A0;
    background: #f0fdfa;
    color: #5BA8A0;
}

/* ─── Color Picker ─── */
.color-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.color-option {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 auto;
}

.color-option:hover {
    transform: scale(1.15);
}

.color-option.selected {
    border-color: #2d3748;
    box-shadow: 0 0 0 3px rgba(91, 168, 160, 0.3);
}

/* ─── Range Labels ─── */
.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 4px;
}

/* ─── Test Voice Button ─── */
.test-voice-btn {
    padding: 12px 20px;
    background: #5BA8A0;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.test-voice-btn:hover {
    background: #4a9990;
}

/* ─── Data Actions ─── */
.data-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.data-action {
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
}

.data-action h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 8px;
}

.data-action p {
    font-size: 0.9rem;
    color: #718096;
    margin: 0 0 14px;
    line-height: 1.4;
}

.data-action.danger {
    border-color: #fed7d7;
    background: #fff5f5;
}

.data-action.danger h4 {
    color: #c53030;
}

.data-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border: 1.5px solid #5BA8A0;
    border-radius: 12px;
    background: #5BA8A0;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.data-btn:hover {
    background: #4a9990;
}

.data-btn.danger {
    background: #e53e3e;
    border-color: #e53e3e;
    color: white;
}

.data-btn.danger:hover {
    background: #c53030;
}

.data-btn.reset {
    background: white;
    color: #718096;
    border-color: #e2e8f0;
}

.data-btn.reset:hover {
    border-color: #5BA8A0;
    color: #5BA8A0;
}

/* ─── Storage Info ─── */
.storage-info {
    background: #f7fafc;
    border-radius: 12px;
    padding: 14px;
    font-size: 0.85rem;
    color: #718096;
    line-height: 1.5;
}

/* ─── Mobile ─── */
@media (max-width: 480px) {
    .settings-module { padding: 10px; }
    .setting-group { padding: 16px; border-radius: 14px; }
    .settings-nav { gap: 6px; }
    .settings-nav-btn { min-width: 60px; padding: 8px 10px; font-size: 0.82rem; }
    .color-picker { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .color-option { width: 40px; height: 40px; }
    .avatar-option { width: 46px; height: 46px; font-size: 1.5rem; }
    .theme-option { min-width: 80px; padding: 10px; }
    .profile-preview { padding: 14px; gap: 12px; }
}
