.settings-container {
    max-width: 100%;
    min-height: 100vh;
    background-color: var(--background-color);
    position: relative;
    display: flex;
    flex-direction: column;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Header Styles */
.settings-header {
    background-color: var(--background-color);
    padding: 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-button {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.5rem;
}

.header-right {
    display: flex;
    gap: 1rem;
    color: var(--text-color);
    align-items: center;
}

.header-right i {
    font-size: 1.2rem;
    cursor: pointer;
}

.app-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-logo img {
    height: 35px;
    object-fit: contain;
    border-radius: 6px;
}

/* Main Content Area */
.settings-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 80px; /* Space for bottom nav */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none; /* Hide scrollbar for IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.settings-content::-webkit-scrollbar {
    display: none;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--background-color);
    z-index: 100;
    border-top: 1px solid var(--border-color);
    text-decoration: none;
}

/* Profile Section */
.profile-section {
    background-color: var(--card-background);
    padding: 2rem 1rem;
    text-align: center;
    position: relative;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-image-container {
    position: relative;
    width: min(140px, 35vw);
    height: min(140px, 35vw);
    margin: 0 auto;
    aspect-ratio: 1;
}

.profile-image {
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    border-radius: 50%;
    background-color: var(--light-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow: hidden;
    z-index: 2;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-image i {
    font-size: 3rem;
    color: white;
}

.profile-completion {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transform-origin: center;
    stroke-dasharray: 377;
    stroke-dashoffset: 150;
    transition: stroke-dashoffset 0.8s ease;
}

.completion-text {
    position: absolute;
    bottom: -5px;
    right: 0;
    background-color: var(--primary-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.image-upload-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    z-index: 3;
}

.profile-info {
    margin-top: 1rem;
    padding: 0 1rem;
}

.profile-info h2 {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 0.8rem;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1rem;
    align-items: center;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-color);
    font-size: 0.95rem;
    background-color: var(--card-background);
    padding: 0.6rem 1rem;
    border-radius: 25px;
    min-width: 250px;
    justify-content: center;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    border: 2px solid var(--primary-color);
}

.detail-item i {
    width: 24px;
    height: 24px;
    background-color: var(--background-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.detail-item span {
    color: var(--text-color);
    flex: 1;
    text-align: center;
    margin: 0 0.5rem;
}

.edit-btn {
    background: none;
    border: none;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-color);
    opacity: 0.7;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.edit-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.edit-btn i {
    background: none;
    width: auto;
    height: auto;
    font-size: 0.9rem;
}

/* Edit mode styles */
.detail-item.editing {
    background-color: var(--card-background);
    border: 2px solid var(--border-color);
}

.detail-item.editing span {
    background: none;
    outline: none;
    border: none;
    text-align: center;
    color: var(--dark-purple);
}

/* Animation for edit button */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.edit-btn:active {
    animation: pulse 0.3s ease;
}

.detail-item:active {
    background-color: var(--border-color);
}

.chat-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--background-color);
    color: var(--text-color);
    border-radius: 20px;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #4CAF50;
    border-radius: 50%;
}

/* Profile Questions */
.profile-questions {
    margin: 1rem;
    border-radius: 12px;
    padding: 1rem;
}

.question-item {
    background-color: var(--card-background);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    margin-bottom: 1rem;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.question-icon {
    width: 40px;
    height: 40px;
    background-color: var(--background-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.question-content {
    flex: 1;
}

.question-content h3 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
    color: var(--text-color);
}

.question-content p {
    font-size: 0.8rem;
    color: var(--secondary-text);
}

.question-item:active {
    background-color: rgba(0,0,0,0.03);
}

/* Profile Stats */
.profile-stats {
    padding: 1rem;
    margin-bottom: 1rem;
   border-radius: 12px;
}

.stats-section h3 {
    margin-bottom: 1rem;
    color: var(--dark-purple);
    padding: 0 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0.5rem;
}

.stat-item {
    background-color: white;
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.stat-icon {
    width: 40px;
    height: 40px;
    background-color: var(--light-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-purple);
}

.stat-item:active {
    background-color: rgba(0,0,0,0.03);
}

/* Account Settings */
.account-settings {
    padding: 1rem;
}

.account-settings h3 {
    margin-bottom: 1rem;
    color: var(--dark-purple);
}

.settings-list {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
}

.settings-item {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

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

.settings-icon {
    width: 40px;
    height: 40px;
    background-color: var(--light-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.settings-info {
    flex: 1;
}

.settings-label {
    font-size: 0.9rem;
    color: #666;
    display: block;
}

.settings-value {
    font-size: 1rem;
    color: var(--dark-purple);
    font-weight: 500;
}

.settings-item:active {
    background-color: rgba(0,0,0,0.03);
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .settings-content {
        padding-bottom: 70px;
    }

    .profile-section {
        padding: 1.5rem 1rem;
    }

    .profile-image-container {
        width: min(120px, 30vw);
        height: min(120px, 30vw);
    }

    .profile-image {
        width: calc(100% - 20px);
        height: calc(100% - 20px);
    }

    .profile-info h2 {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .progress-ring-circle {
        stroke-width: 6;
    }

    .profile-questions {
        margin: 0.5rem;
    }

    .theme-toggle-container {
        margin: 0.8rem;
        padding: 1.4rem;
    }

    .theme-toggle-container h3 {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 320px) {
    .profile-image-container {
        width: min(100px, 25vw);
        height: min(100px, 25vw);
    }

    .progress-ring-circle {
        stroke-width: 5;
    }
}

/* Calculate progress ring animation */
@keyframes progress {
    from {
        stroke-dashoffset: 377;
    }
    to {
        stroke-dashoffset: 150;
    }
}

.progress-ring-circle {
    animation: progress 1.5s ease-out forwards;
}

/* Improve touch interactions */
.detail-item, .question-item, .settings-item, .stat-item, .edit-btn {
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

/* Button active state for better mobile feedback */
button, .edit-btn, .image-upload-btn {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.detail-item:active, .question-item:active, .stat-item:active {
    background-color: rgba(0,0,0,0.03);
}

.theme-toggle-container {
    background-color: var(--card-background);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.theme-toggle-container h3 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

.theme-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.theme-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.light-icon {
    background-color: #f8f9fa;
    color: #ff9800;
    border: 1px solid var(--border-color);
}

.dark-icon {
    background-color: #2c3e50;
    color: #b0bec5;
    border: 1px solid var(--border-color);
}

#lightTheme span {
    color: var(--text-color);
    font-size: 0.85rem;
}

#darkTheme span {
    color: var(--text-color);
    font-size: 0.85rem;
}

/* Switch styling */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin: 0 0.5rem;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .theme-toggle-wrapper {
        padding: 0.8rem;
    }
    
    .theme-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .theme-option {
        padding: 0 1rem;
    }
}

/* Apply theme variables to settings page elements */
.settings-container {
    background-color: var(--background-color);
}

.settings-header {
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
}

.back-button {
    color: var(--text-color);
}

.header-right {
    color: var(--text-color);
}

.profile-section {
    background-color: var(--card-background);
}

.profile-info h2 {
    color: var(--text-color);
}

.detail-item {
    background-color: var(--card-background);
    color: var(--text-color);
}

.detail-item span {
    color: var(--text-color);
}

.detail-item:active {
    background-color: var(--border-color);
}


.question-content h3 {
    color: var(--text-color);
}

.question-content p {
    color: var(--secondary-text);
}

/* Email change message */
.email-change-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    width: 90%;
    max-width: 400px;
    z-index: 9999;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.email-change-message.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.message-content {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    align-items: flex-start;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
}

.message-content i.fa-info-circle {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-right: 0.8rem;
    flex-shrink: 0;
}

.message-content p {
    flex: 1;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-color);
}

.close-message {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0;
    margin-left: 0.8rem;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.close-message:hover {
    opacity: 1;
}

/* Make the email field appear interactive */
#profileEmail {
    position: relative;
    cursor: pointer;
}

#profileEmail:hover {
    color: var(--primary-color);
}

#profileEmail::after {
    content: "🔒";
    margin-left: 6px;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Personality Question Button */
.personality-question-btn {
    background-color: var(--card-background);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer !important;
    margin: 1rem;
    -webkit-tap-highlight-color: transparent;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
}

.personality-question-btn * {
    pointer-events: none; /* Make sure clicks go to the button, not children */
}

.personality-question-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.personality-question-btn:active {
    transform: translateY(0);
    background-color: rgba(0,0,0,0.03);
}

.personality-question-btn .question-icon {
    width: 40px;
    height: 40px;
    background-color: var(--background-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.personality-question-btn .question-content {
    flex: 1;
}

.personality-question-btn .question-content h3 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
    color: var(--text-color);
}

.personality-question-btn .question-content p {
    font-size: 0.8rem;
    color: var(--secondary-text);
    transition: all 0.3s ease;
}

.personality-question-btn .question-content p.has-result {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
    padding: 0.2rem 0.5rem;
    background-color: rgba(108, 64, 192, 0.1);
    border-radius: 12px;
    margin-top: 0.2rem;
    display: inline-block;
}

/* Personality Test Popup */
.personality-test-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow-y: auto;
}

.personality-test-popup.active {
    display: flex !important;
}

.popup-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--card-background);
    position: sticky;
    top: 0;
    z-index: 10;
}

.popup-header h2 {
    font-size: 1.3rem;
    color: var(--text-color);
}

.close-popup {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-popup:hover {
    background-color: var(--border-color);
}

.popup-content {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.question-container {
    max-width: 500px;
    width: 100%;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.question-counter {
    font-size: 0.9rem;
    color: var(--secondary-text);
    margin-bottom: 1rem;
    text-align: center;
}

.question-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.4;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 100;
}

.answer-btn {
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer !important;
    transition: all 0.2s ease;
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
}

.answer-btn:hover, .answer-btn:focus {
    background-color: var(--border-color);
    color: var(--text-color);
    transform: translateY(-2px);
}

.answer-btn:active {
    transform: translateY(0);
    background-color: var(--border-color);
}

.answer-btn.active {
    background-color: var(--border-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

/* Add a ripple effect for better touch feedback */
.answer-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.answer-btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0) translate(-50%, -50%);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20) translate(-50%, -50%);
        opacity: 0;
    }
}

.progress-bar-container {
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 10%;
    transition: width 0.3s ease;
}

.result-container {
    max-width: 500px;
    width: 100%;
    padding: 2rem;
    background-color: var(--card-background);
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.result-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.personality-type {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 1rem 0;
}

.personality-description {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.restart-test-btn {
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.restart-test-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Animation for popup */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.personality-test-popup.active {
    animation: fadeIn 0.3s ease forwards;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .question-container, 
    .result-container {
        padding: 1rem;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .answer-btn {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
} 