:root {
    --bg-color: #f5f7fa;
    --card-bg-color: #ffffff;
    --text-color: #333;
    --subtle-text-color: #6c757d;
    --border-color: #e9ecef;
    --primary-color: #2563eb;
    --danger-color: #dc3545;
    --shadow-color: rgba(0, 0, 0, 0.05);
}

body.dark-mode {
    --bg-color: #121212;
    --card-bg-color: #1e1e1e;
    --text-color: #e0e0e0;
    --subtle-text-color: #a0a0a0;
    --border-color: #2c2c2c;
}

body {
    margin: 0 0 80px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

.header {
    background: var(--card-bg-color);
    box-shadow: 0 2px 4px var(--shadow-color);
    padding: 16px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2em;
    cursor: pointer;
    padding: 0;
}

.header h1 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
}

.content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-card {
    background: var(--card-bg-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.profile-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-weight: 600;
    font-size: 1.1em;
}

.profile-email {
    font-size: 0.9em;
    color: var(--subtle-text-color);
}

.edit-profile-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1em;
}

.card-title {
    font-size: 1em;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--subtle-text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.settings-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

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

.item-icon {
    width: 30px;
    margin-right: 16px;
    color: var(--primary-color);
    text-align: center;
}

.item-label {
    flex-grow: 1;
    font-weight: 500;
}

.item-arrow {
    color: var(--subtle-text-color);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

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

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

.logout-section {
    margin-top: 16px;
}

.logout-btn {
    width: 100%;
    padding: 16px;
    border: none;
    background-color: var(--danger-color);
    color: white;
    font-size: 1em;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Modern Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: var(--card-bg-color);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 400px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin: -24px -24px 20px -24px;
    background: linear-gradient(120deg, #ff7043 0%, #ff9800 100%);
    color: white;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2em;
    color: white;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: white;
    transition: opacity 0.2s;
}

.close-modal-btn:hover {
    opacity: 0.8;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9em;
    color: var(--subtle-text-color);
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--subtle-text-color);
}

.modal-body input {
    width: 100%;
    padding: 12px 12px 12px 45px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-body input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.policy-content {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0;
}

.policy-content p {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
    color: #333;
}

.policy-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 12px 0 6px 0;
    color: #2c3e50;
    border-bottom: 2px solid #ff7043;
    padding-bottom: 4px;
}

.policy-content ul {
    margin: 4px 0 8px 20px;
    padding-left: 0;
}

.policy-content li {
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 3px;
    color: #555;
}

.policy-content strong {
    color: #2c3e50;
    font-weight: 600;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.modal-btn {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.modal-btn:active {
    transform: scale(0.97);
}

.modal-btn.cancel {
    background-color: #eee;
    color: #333;
}

body.dark-mode .modal-btn.cancel {
    background-color: #2c2c2c;
    color: #eee;
}

.modal-btn {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .policy-content {
        max-height: 70vh;
        padding: 0;
    }
    
    .policy-content p {
        font-size: 15px;
        line-height: 1.5;
        margin-bottom: 10px;
    }
    
    .policy-content h3 {
        font-size: 17px;
        margin: 16px 0 8px 0;
    }
    
    .policy-content li {
        font-size: 15px;
        line-height: 1.4;
        margin-bottom: 4px;
    }
    
    .modal-body {
        padding: 16px 12px;
    }
}

/* Android specific optimizations */
@media (max-width: 480px) {
    .modal-box {
        width: 95%;
        max-width: 95%;
        margin: 20px auto;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 12px 16px;
        margin: -16px -16px 12px -16px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .policy-content {
        max-height: 65vh;
        font-size: 14px;
    }
    
    .policy-content p {
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 8px;
    }
    
    .policy-content h3 {
        font-size: 16px;
        margin: 12px 0 6px 0;
        padding-bottom: 3px;
    }
    
    .policy-content li {
        font-size: 14px;
        line-height: 1.3;
        margin-bottom: 3px;
    }
    
    .policy-content ul {
        margin: 3px 0 6px 16px;
    }
    
    .modal-body {
        padding: 12px 10px;
    }
    
    .modal-footer {
        padding: 12px 16px;
    }
    
    .modal-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .modal-box {
        width: 98%;
        margin: 10px auto;
    }
    
    .modal-header {
        padding: 10px 12px;
        margin: -12px -12px 10px -12px;
    }
    
    .modal-header h2 {
        font-size: 16px;
    }
    
    .policy-content {
        max-height: 60vh;
    }
    
    .policy-content p {
        font-size: 13px;
        line-height: 1.3;
        margin-bottom: 6px;
    }
    
    .policy-content h3 {
        font-size: 15px;
        margin: 10px 0 5px 0;
    }
    
    .policy-content li {
        font-size: 13px;
        line-height: 1.2;
        margin-bottom: 2px;
    }
    
    .policy-content ul {
        margin: 2px 0 5px 14px;
    }
    
    .modal-body {
        padding: 10px 8px;
    }
    
    .modal-footer {
        padding: 10px 12px;
    }
    
    .modal-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 12px;
        gap: 12px;
    }

    .settings-card {
        padding: 12px;
    }

    .profile-avatar {
        width: 50px;
        height: 50px;
    }

    .profile-name {
        font-size: 1em;
    }
}

#passwordLoadingOverlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
    color: #ff9800;
    font-weight: bold;
    pointer-events: all;
}
#passwordLoadingOverlay > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#passwordLoadingOverlay .spinner {
    border: 5px solid #ff9800;
    border-top: 5px solid #ff7043;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
    display: block;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#passwordSuccessModal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.18);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}
.password-success-box {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.18);
    padding: 24px 18px 18px 18px;
    max-width: 400px;
    width: 90vw;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: popupFadeIn 0.5s cubic-bezier(.4,2,.3,1);
    position: relative;
}
.password-success-icon {
    font-size: 3.5em;
    color: #4caf50;
    margin-bottom: 18px;
    animation: popScale 0.6s cubic-bezier(.4,2,.3,1);
}
.password-success-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}
#closePasswordSuccessBtn.modal-btn {
    background: linear-gradient(90deg, #ff7043 0%, #ff9800 100%);
    color: #fff;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    padding: 10px 32px;
    box-shadow: 0 2px 8px #ff980033;
    cursor: pointer;
    margin-top: 0;
    transition: background 0.2s, transform 0.2s;
}
#closePasswordSuccessBtn.modal-btn:hover {
    background: linear-gradient(90deg, #ff9800 0%, #ff7043 100%);
    transform: scale(1.04);
} 