/* ==================== SETTINGS PAGE ==================== */

/* Settings Layout */
.settings-layout {
    display: flex;
    gap: var(--space-xl);
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-lg);
}

/* ==================== SETTINGS NAVIGATION ==================== */
.settings-nav {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-height) + var(--space-lg));
    height: fit-content;
}

.settings-nav-list {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    color: var(--text-dim);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    border-bottom: 1px solid var(--border-default);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.settings-nav-item:last-child {
    border-bottom: none;
}

.settings-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-white);
}

.settings-nav-item.active {
    background: var(--fitness-teal-light);
    color: var(--fitness-teal);
}

.settings-nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.settings-nav-item.danger {
    color: var(--error);
}

.settings-nav-item.danger:hover {
    background: rgba(229, 57, 53, 0.1);
}

/* ==================== SETTINGS CONTENT ==================== */
.settings-content {
    flex: 1;
    min-width: 0;
}

/* Settings Section */
.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-lg);
    overflow: hidden;
}

.settings-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-default);
}

.settings-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.settings-section-title h2 {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-white);
    margin: 0;
}

.settings-section-title svg {
    width: 24px;
    height: 24px;
    color: var(--fitness-teal);
}

.settings-section-badge {
    padding: 4px 10px;
    background: var(--fitness-teal-light);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--fitness-teal);
}

.settings-section-body {
    padding: var(--space-lg);
}

/* ==================== SETTINGS ITEMS ==================== */
.settings-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-lg);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-default);
}

.settings-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-item:first-child {
    padding-top: 0;
}

.settings-item-info {
    flex: 1;
}

.settings-item-label {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-white);
    margin-bottom: 4px;
}

.settings-item-description {
    font-size: var(--text-sm);
    color: var(--text-dim);
    line-height: 1.5;
}

.settings-item-action {
    flex-shrink: 0;
}

/* ==================== TOGGLE SWITCH ==================== */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--text-dim);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--fitness-teal);
    border-color: var(--fitness-teal);
}

.toggle-switch input:checked + .toggle-slider::before {
    background: var(--text-white);
    transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px var(--fitness-teal-light);
}

/* ==================== SELECT DROPDOWN ==================== */
.settings-select {
    min-width: 160px;
    padding: var(--space-sm) var(--space-md);
    padding-right: var(--space-xl);
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-white);
    font-size: var(--text-sm);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all var(--transition-fast);
}

.settings-select:hover {
    border-color: var(--border-hover);
}

.settings-select:focus {
    outline: none;
    border-color: var(--fitness-teal);
    box-shadow: 0 0 0 3px var(--fitness-teal-light);
}

.settings-select option {
    background: var(--bg-card);
    color: var(--text-white);
}

/* ==================== TEXT INPUT ==================== */
.settings-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-white);
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
}

.settings-input:hover {
    border-color: var(--border-hover);
}

.settings-input:focus {
    outline: none;
    border-color: var(--fitness-teal);
    box-shadow: 0 0 0 3px var(--fitness-teal-light);
}

.settings-input::placeholder {
    color: var(--text-dim);
}

.settings-input-group {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.settings-input-group .settings-input {
    flex: 1;
}

/* ==================== PROFILE SECTION ==================== */
.profile-header {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-default);
}

.profile-avatar-section {
    position: relative;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--bg-input);
}

.profile-avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fitness-teal);
    border: 2px solid var(--bg-card);
    border-radius: var(--radius-full);
    color: var(--text-white);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.profile-avatar-edit:hover {
    transform: scale(1.1);
}

.profile-avatar-edit svg {
    width: 14px;
    height: 14px;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 4px;
}

.profile-username {
    font-size: var(--text-sm);
    color: var(--text-dim);
}

.profile-form {
    padding: var(--space-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group.full-width {
    grid-column: span 2;
}

.form-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-muted);
}

.form-textarea {
    width: 100%;
    min-height: 100px;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-white);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    resize: vertical;
    transition: all var(--transition-fast);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--fitness-teal);
    box-shadow: 0 0 0 3px var(--fitness-teal-light);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-default);
    margin-top: var(--space-md);
}

/* ==================== SECURITY SECTION ==================== */
.security-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-hover);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.security-item:last-child {
    margin-bottom: 0;
}

.security-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    color: var(--fitness-teal);
}

.security-icon svg {
    width: 22px;
    height: 22px;
}

.security-icon.warning {
    color: var(--warning);
}

.security-icon.success {
    color: var(--success);
}

.security-info {
    flex: 1;
}

.security-title {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-white);
    margin-bottom: 2px;
}

.security-status {
    font-size: var(--text-sm);
    color: var(--text-dim);
}

.security-status.enabled {
    color: var(--success);
}

.security-status.disabled {
    color: var(--warning);
}

/* Sessions List */
.sessions-list {
    margin-top: var(--space-md);
}

.session-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-hover);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-sm);
}

.session-item.current {
    border: 1px solid var(--fitness-teal);
}

.session-item:last-child {
    margin-bottom: 0;
}

.session-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    color: var(--text-dim);
}

.session-icon svg {
    width: 20px;
    height: 20px;
}

.session-info {
    flex: 1;
}

.session-device {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.session-current-badge {
    padding: 2px 8px;
    background: var(--fitness-teal-light);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    color: var(--fitness-teal);
}

.session-details {
    font-size: var(--text-xs);
    color: var(--text-dim);
    margin-top: 2px;
}

.session-revoke {
    padding: var(--space-xs) var(--space-sm);
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-dim);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.session-revoke:hover {
    border-color: var(--error);
    color: var(--error);
    background: rgba(229, 57, 53, 0.1);
}

/* ==================== NOTIFICATION PREFERENCES ==================== */
.notification-group {
    margin-bottom: var(--space-lg);
}

.notification-group:last-child {
    margin-bottom: 0;
}

.notification-group-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-default);
}

/* ==================== THEME SELECTION ==================== */
.theme-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.theme-option {
    position: relative;
    padding: var(--space-md);
    background: var(--bg-hover);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.theme-option.active {
    border-color: var(--fitness-teal);
}

.theme-option input {
    position: absolute;
    opacity: 0;
}

.theme-preview {
    height: 60px;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    display: flex;
    overflow: hidden;
}

.theme-preview-dark {
    flex: 1;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.theme-preview-light {
    flex: 1;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.theme-preview-auto {
    flex: 1;
    background: linear-gradient(135deg, #1a1a2e 0%, #f5f5f5 100%);
}

.theme-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-white);
    text-align: center;
}

.theme-check {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--fitness-teal);
    border-radius: var(--radius-full);
    color: var(--text-white);
}

.theme-option.active .theme-check {
    display: flex;
}

.theme-check svg {
    width: 12px;
    height: 12px;
}

/* ==================== PLATFORM PREFERENCES ==================== */
.platform-prefs {
    display: grid;
    gap: var(--space-md);
}

.platform-pref-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-hover);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
}

.platform-pref-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.platform-pref-icon svg {
    width: 24px;
    height: 24px;
}

.platform-pref-icon[data-platform="soulmate"] {
    background: var(--soulmate-red-light);
    color: var(--soulmate-red);
}

.platform-pref-icon[data-platform="creator"] {
    background: var(--creator-orange-light);
    color: var(--creator-orange);
}

.platform-pref-icon[data-platform="ai"] {
    background: var(--ai-gold-light);
    color: var(--ai-gold);
}

.platform-pref-icon[data-platform="professional"] {
    background: var(--professional-yellow-light);
    color: var(--professional-yellow);
}

.platform-pref-icon[data-platform="fitness"] {
    background: var(--fitness-teal-light);
    color: var(--fitness-teal);
}

.platform-pref-info {
    flex: 1;
}

.platform-pref-name {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-white);
    margin-bottom: 2px;
}

.platform-pref-status {
    font-size: var(--text-sm);
    color: var(--text-dim);
}

/* ==================== DATA & STORAGE ==================== */
.storage-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: var(--space-md) 0;
}

.storage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--fitness-teal), var(--ai-gold));
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.storage-info {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-sm);
    color: var(--text-dim);
}

.storage-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.storage-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.storage-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
}

.storage-dot.posts { background: var(--fitness-teal); }
.storage-dot.media { background: var(--ai-gold); }
.storage-dot.messages { background: var(--creator-orange); }
.storage-dot.other { background: var(--text-dim); }

.storage-label {
    font-size: var(--text-sm);
    color: var(--text-dim);
}

.storage-value {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-white);
    margin-left: auto;
}

/* ==================== DANGER ZONE ==================== */
.danger-zone {
    border-color: var(--error);
}

.danger-zone .settings-section-header {
    background: rgba(229, 57, 53, 0.1);
}

.danger-zone .settings-section-title svg {
    color: var(--error);
}

.danger-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    padding: var(--space-md);
    background: rgba(229, 57, 53, 0.05);
    border: 1px solid rgba(229, 57, 53, 0.2);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.danger-item:last-child {
    margin-bottom: 0;
}

.danger-item-info h4 {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--error);
    margin-bottom: 4px;
}

.danger-item-info p {
    font-size: var(--text-sm);
    color: var(--text-dim);
}

/* ==================== MODAL ==================== */
.settings-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 1000;
}

.settings-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.settings-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.settings-modal-overlay.active .settings-modal {
    transform: scale(1);
}

.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-default);
}

.settings-modal-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-white);
}

.settings-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-dim);
    cursor: pointer;
}

.settings-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-white);
}

.settings-modal-close svg {
    width: 18px;
    height: 18px;
}

.settings-modal-body {
    padding: var(--space-lg);
}

.settings-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-top: 1px solid var(--border-default);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
    .settings-layout {
        flex-direction: column;
    }

    .settings-nav {
        width: 100%;
        position: static;
    }

    .settings-nav-list {
        display: flex;
        overflow-x: auto;
        gap: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

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

    .settings-nav-item {
        flex-shrink: 0;
        padding: var(--space-sm) var(--space-md);
        border-bottom: none;
        border-right: 1px solid var(--border-default);
        white-space: nowrap;
    }

    .settings-nav-item:last-child {
        border-right: none;
    }
}

@media (max-width: 640px) {
    .settings-layout {
        padding: var(--space-sm);
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .theme-options {
        grid-template-columns: 1fr;
    }

    .settings-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .settings-item-action {
        width: 100%;
    }

    .settings-select {
        width: 100%;
    }

    .security-item,
    .session-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .session-revoke {
        margin-top: var(--space-sm);
    }

    .danger-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .danger-item .btn {
        width: 100%;
        margin-top: var(--space-sm);
    }
}
