/* Styles for Settings App */
#app-settings {
    background-color: #f2f2f7;
    overflow-y: auto;
    display: block; /* Override flex */
    z-index: 3; /* To be on top of other settings pages initially */
}

.settings-header {
    padding: 44px 20px 10px 20px;
    background-color: #f2f2f7;
    position: sticky;
    top: 0;
    z-index: 2;
}

.settings-header.nav-header {
    display: flex;
    align-items: center;
    padding-top: 55px;
    padding-bottom: 10px;
}

.settings-header.nav-header h1 {
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    flex-grow: 1;
    /* Move it slightly right to center it, compensating for back button */
    margin-left: -50px; 
}

.settings-back-button {
    background: none;
    border: none;
    color: #007aff;
    font-size: 17px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.settings-back-button .back-arrow {
    font-size: 30px;
    font-weight: 400;
    line-height: 1;
    transform: scaleX(0.7);
    margin-right: 4px;
}

.settings-content {
    padding: 0 20px 20px 20px;
}

.settings-group {
    background-color: #fff;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.settings-group.search-container {
    background-color: transparent;
}

.search-bar {
    background-color: #E4E4E6;
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-icon {
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%238e8e93' d='M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.8;
}

.search-bar input {
    flex-grow: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    outline: none;
}
.search-bar input::placeholder {
    color: #8e8e93;
}

.settings-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.settings-list li {
    background-color: white;
    padding: 12px 20px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 16px;
}

.settings-list li:first-child {
    border-top: 1px solid #e0e0e0;
    margin-top: 30px;
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    font-size: 16px;
    position: relative;
    cursor: pointer;
}

.settings-item:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15px;
    right: 0;
    height: 1px;
    background-color: #e5e5ea;
}

.profile-section {
    padding-left: 10px;
    cursor: default;
}

#profile-section-button {
    cursor: pointer;
}

.profile-section .profile-text {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.profile-section .chevron {
    margin-left: auto;
}

.settings-item.profile-section:not(:last-child)::after {
    left: 65px;
}

.profile-avatar-container {
    margin-right: 15px;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    background-color: #ccc;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: 500;
    color: #fff;
}

.profile-name {
    font-size: 18px;
    font-weight: 500;
}

.profile-sub {
    font-size: 12px;
    color: #666;
}

.chevron {
    color: #c7c7cc;
    font-weight: 700;
    margin-left: auto;
}

.setting-value {
    margin-left: auto;
    margin-right: 10px;
    color: #8e8e93;
}

.toggle-switch {
    width: 51px;
    height: 31px;
    background-color: #e9e9eb;
    border-radius: 16px;
    margin-left: auto;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.toggle-switch .toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.toggle-switch.on {
    background-color: #34c759;
}

.toggle-switch.on .toggle-knob {
    transform: translateX(20px);
}