/* CSS Variables for consistent theming */
:root {
    --primary-color: #38a169;
    --secondary-color: #2f855a;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --success-color: #38a169;
    --error-color: #e53e3e;
    --error-bg: #fed7d7;
}

/* Authentication Modal Styles */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal.show {
    opacity: 1;
    visibility: visible;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.auth-modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 650px; /* Increased width for better content visibility */
    /* Make modal content a flex column and constrain height for internal scrolling */
    display: flex;
    flex-direction: column;
    max-height: 95dvh; /* better mobile viewport units */
    overscroll-behavior: contain;
    touch-action: pan-y;
    z-index: 1; /* ensure above overlay */
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.auth-modal.show .auth-modal-content {
    transform: scale(1) translateY(0);
}

.auth-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.auth-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.auth-close-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.auth-modal-body {
    padding: 24px;
    overflow-y: auto; /* scroll inside modal */
    -webkit-overflow-scrolling: touch; /* smooth iOS scrolling */
    flex: 1 1 auto;
    min-height: 0; /* allow flex child to shrink for scroll */
}

.auth-modal-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--border-color);
}

.auth-footer-text {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.4;
}

.auth-footer-text a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-footer-text a:hover {
    text-decoration: underline;
}

/* Auth Options */
.auth-options {
    text-align: center;
}

.auth-options p {
    margin: 0 0 24px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.auth-option-btn {
    display: block;
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 12px;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-option-btn i {
    margin-right: 12px;
    font-size: 1.1rem;
}

.auth-option-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--primary-color);
}

.auth-option-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(25, 195, 125, 0.3);
}

.auth-option-btn.secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.auth-option-btn.secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--text-secondary);
}

/* Auth Forms */
.auth-form {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.auth-form h3 {
    margin: 0 0 24px;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.auth-form p {
    margin: 0 0 24px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(25, 195, 125, 0.1);
}

.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--text-primary);
}

.password-strength {
    margin-top: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.password-strength.weak {
    color: #ef4444;
}

.password-strength.medium {
    color: #f59e0b;
}

.password-strength.strong {
    color: var(--success-color);
}

/* Fix the hovering form actions layout */
.form-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    position: static; /* Ensure not floating */
    z-index: auto; /* Remove any z-index conflicts */
}

/* Remember me checkbox section */
.remember-me-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    position: static; /* Prevent floating */
}

.remember-me-label input[type="checkbox"] {
    width: auto;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

/* Submit button */
.auth-submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: static; /* Prevent floating */
    display: block;
    text-align: center;
    box-sizing: border-box;
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(25, 195, 125, 0.3);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Forgot password link */
.form-actions a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    text-align: center;
    display: block;
    position: static; /* Prevent floating */
    margin: 0 auto;
}

.form-actions a:hover {
    text-decoration: underline;
}

/* Additional fixes for specific form action layout */
.form-actions.flex {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
}

.form-actions.flex .remember-me-label {
    align-self: flex-start;
    width: 100%;
}

.form-actions.flex .auth-submit-btn {
    width: 100%;
    order: 2;
}

.form-actions.flex a {
    order: 3;
    margin-left: 0 !important; /* Override ml-auto */
    align-self: center;
}

/* Auth Divider */
.auth-divider {
    margin: 24px 0;
    text-align: center;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    background: var(--bg-primary);
    color: var(--text-secondary);
    padding: 0 16px;
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
}

/* OAuth Buttons */
.oauth-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.oauth-btn {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.oauth-btn:hover {
    border-color: var(--text-secondary);
    transform: translateY(-1px);
}

.google-btn:hover {
    border-color: #4285f4;
    color: #4285f4;
}

.microsoft-btn:hover {
    border-color: #0078d4;
    color: #0078d4;
}

/* Auth Switch */
.auth-switch {
    margin: 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Back Button */
.auth-back-btn {
    margin-top: 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.auth-back-btn:hover {
    color: var(--text-primary);
}

/* reCAPTCHA and Enhanced Captcha */
.g-recaptcha {
    margin: 16px 0;
    display: flex;
    justify-content: center;
}

.enhanced-captcha {
    margin: 16px 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    background: var(--bg-secondary);
}

.math-captcha {
    margin-bottom: 12px;
}

.math-captcha label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.math-problem {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.math-problem span {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 80px;
}

.math-problem input {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 1rem;
}

.captcha-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.captcha-toggle:hover {
    color: var(--secondary-color);
}

.auth-language-selector {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.auth-language-selector label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.auth-language-selector .select-container {
    position: relative;
}

.auth-language-selector .language-dropdown {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.auth-language-selector .language-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
}

.auth-language-selector .select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* Remember Me Checkbox */
.remember-me-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin: 16px 0;
}

.remember-me-label input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.remember-me-label input[type="checkbox"]:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.remember-me-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkmark {
    display: none; /* Hidden as we use CSS-only checkbox */
}



/* Profile Modal (as centered popup overlay) */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none; /* toggled to flex via JS */
    align-items: center;
    justify-content: center;
    z-index: 10002; /* above other UI */
    /* Ensure wrapper has no card styling (override older styles) */
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

.profile-modal.show {
    /* visibility handled by JS + content animation below */
}

/* Stronger, ID-scoped overrides to ensure centered popup behavior */
#profileModal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#profileModal.show { display: flex; }

#profileModal .profile-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

#profileModal .profile-modal-content {
    background: var(--bg-primary, #fff);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 92%;
    max-width: 520px;
    padding: 32px 24px;
    position: relative;
    z-index: 10001;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    max-height: 90dvh; /* use dynamic viewport height */
    overscroll-behavior: contain;
    touch-action: pan-y;
}

#profileModal.show .profile-modal-content {
    transform: scale(1) translateY(0);
}

/* Make the profile picture change control prominent */
.profile-picture-container {
    width: 96px;
    height: 96px;
    border: 3px solid var(--primary-color);
}

.profile-picture-overlay {
    width: 40px;
    height: 40px;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.profile-picture-overlay .upload-btn i {
    font-size: 16px;
}

/* Visible CTA under avatar */
.profile-picture-cta {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 200px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(25, 195, 125, 0.2);
}

.profile-picture-cta:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 195, 125, 0.3);
}

.profile-picture-cta i {
    color: white;
    font-size: 1rem;
}

/* User Status Indicator */
.user-status {
    position: relative;
    cursor: pointer;
}

.user-status .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-status.guest .user-avatar {
    background: var(--text-secondary);
}
.popup-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
}

.popup-close {
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.popup-close:hover {
    color: #718096;
    background: #f7fafc;
}

/* User Profile Modal Styles */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.profile-modal[style*="flex"] {
    opacity: 1;
    visibility: visible;
}

.profile-modal.show {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

.profile-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.profile-modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    max-height: 90dvh; /* use dynamic viewport height */
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.profile-modal.show .profile-modal-content,
.profile-modal[style*="flex"] .profile-modal-content {
    transform: scale(1) translateY(0);
}

.profile-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.profile-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.profile-close-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.profile-modal-body {
    padding: 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
}

.profile-info {
    text-align: center;
    margin-bottom: 32px;
}

.profile-avatar {
    margin-bottom: 24px;
}

.profile-picture-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 4px solid var(--border-color);
    transition: all 0.3s ease;
}

.profile-picture-container:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

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

.profile-picture-container i {
    font-size: 80px;
    color: var(--text-secondary);
    line-height: 112px;
    width: 100%;
    text-align: center;
}

.profile-picture-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-picture-container:hover .profile-picture-overlay {
    opacity: 1;
}

.upload-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.profile-picture-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 200px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(25, 195, 125, 0.2);
}

.profile-picture-cta:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 195, 125, 0.3);
}

.profile-picture-cta i {
    color: white;
    font-size: 1rem;
}

.profile-details h3 {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.profile-details p {
    margin: 4px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.profile-actions {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(56, 161, 105, 0.2);
}

.profile-action-btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 161, 105, 0.3);
    border-color: var(--primary-color);
}

.profile-action-btn.danger {
    background: linear-gradient(135deg, #fed7d7, #feb2b2);
    color: #c53030;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.profile-action-btn.danger:hover {
    background: linear-gradient(135deg, #feb2b2, #fc8181);
    border-color: #e53e3e;
    color: #9b2c2c;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.profile-action-btn i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    padding: 4px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.profile-action-btn.danger i {
    background: rgba(255, 255, 255, 0.8);
    color: #e53e3e;
}

/* Admin Panel Styles */
.admin-only {
    border-color: var(--secondary-color) !important;
    color: var(--secondary-color) !important;
}

.admin-only:hover {
    background: rgba(255, 215, 0, 0.1) !important;
    border-color: #e6ac00 !important;
    color: #e6ac00 !important;
}

/* Admin Panel Button Special Styling */
.admin-only {
    background: linear-gradient(135deg, #fef5e7, #fed7aa) !important;
    color: #d69e2e !important;
    border-color: transparent !important;
}

.admin-only:hover {
    background: linear-gradient(135deg, #fed7aa, #fbb86f) !important;
    border-color: #d69e2e !important;
    color: #b7791f !important;
}

.admin-only i {
    background: rgba(255, 255, 255, 0.8) !important;
    color: #d69e2e !important;
}

/* Edit Profile and Change Password Modal Styles */
.edit-profile-modal,
.change-password-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.edit-profile-modal.show,
.change-password-modal.show {
    opacity: 1;
    visibility: visible;
}

.edit-profile-modal-overlay,
.change-password-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.edit-profile-modal-content,
.change-password-modal-content {
    position: relative;
    background: var(--bg-primary, #fff);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    z-index: 10003;
    display: flex;
    flex-direction: column;
    max-height: 90dvh;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.edit-profile-modal.show .edit-profile-modal-content,
.change-password-modal.show .change-password-modal-content {
    transform: scale(1) translateY(0);
}

.edit-profile-modal-header,
.change-password-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f8fafc, #edf2f7);
    border-radius: 16px 16px 0 0;
}

.edit-profile-modal-header h3,
.change-password-modal-header h3 {
    margin: 0;
    color: var(--text-primary, #2d3748);
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.edit-profile-modal-header h3 i,
.change-password-modal-header h3 i {
    color: var(--primary-color, #38a169);
    font-size: 1.2rem;
}

.edit-profile-close-btn,
.change-password-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary, #718096);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-profile-close-btn:hover,
.change-password-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary, #2d3748);
    transform: scale(1.1);
}

.edit-profile-modal-body,
.change-password-modal-body {
    padding: 32px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
}

.edit-profile-form,
.change-password-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.edit-profile-form .form-group,
.change-password-form .form-group {
    margin-bottom: 20px;
}

.edit-profile-form .form-group label,
.change-password-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary, #2d3748);
    font-weight: 600;
    font-size: 0.95rem;
}

.edit-profile-form .form-group input,
.change-password-form .form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #2d3748);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.edit-profile-form .form-group input:focus,
.change-password-form .form-group input:focus {
    outline: none;
    border-color: var(--primary-color, #38a169);
    box-shadow: 0 0 0 4px rgba(56, 161, 105, 0.1);
    transform: translateY(-1px);
}

.edit-profile-form .form-actions,
.change-password-form .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.edit-profile-submit-btn,
.change-password-submit-btn {
    flex: 1;
    padding: 16px 24px;
    background: white;
    color: #2d3748;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.change-password-submit-btn:hover {
    background: linear-gradient(135deg, #38a169, #2f855a);
    color: white;
    border-color: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 161, 105, 0.3);
}

.edit-profile-cancel-btn,
.change-password-cancel-btn {
    flex: 1;
    padding: 16px 24px;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    color: var(--text-primary, #2d3748);
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.edit-profile-cancel-btn:hover,
.change-password-cancel-btn:hover {
    background: linear-gradient(135deg, #edf2f7, #e2e8f0);
    border-color: var(--text-secondary, #718096);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Loading states for form buttons */
.edit-profile-submit-btn.loading,
.change-password-submit-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.edit-profile-submit-btn.loading::after,
.change-password-submit-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success and error messages in modals */
.modal-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-message.success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.modal-message.error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.modal-message i {
    font-size: 1.1rem;
}

/* Responsive design for edit modals */
@media (max-width: 768px) {
    .edit-profile-modal-content,
    .change-password-modal-content {
        width: 95%;
        margin: 20px;
    }

    .edit-profile-modal-body,
    .change-password-modal-body {
        padding: 24px 20px;
    }

    .edit-profile-form .form-actions,
    .change-password-form .form-actions {
        flex-direction: column;
    }

    .edit-profile-submit-btn,
    .change-password-submit-btn,
    .edit-profile-cancel-btn,
    .change-password-cancel-btn {
        width: 100%;
    }
}

/* Logout Confirmation Modal Styles */
.logout-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.logout-modal[style*="1"] {
    opacity: 1;
    visibility: visible;
}

.logout-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.logout-modal-content {
    position: relative;
    background: var(--bg-primary, #fff);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    z-index: 10003;
}

.logout-modal[style*="1"] .logout-modal-content {
    transform: scale(1) translateY(0);
}

.logout-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #fed7d7, #feb2b2);
    border-radius: 16px 16px 0 0;
}

.logout-modal-header h3 {
    margin: 0;
    color: #c53030;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logout-modal-header h3::before {
    content: '⚠️';
    font-size: 1.2rem;
}

.logout-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #c53030;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-close-btn:hover {
    background: rgba(197, 48, 48, 0.1);
    color: #9b2c2c;
    transform: scale(1.1);
}

.logout-modal-body {
    padding: 32px 24px;
    text-align: center;
}

.logout-modal-body p {
    margin: 0 0 24px;
    color: var(--text-primary, #2d3748);
    font-size: 1.1rem;
    line-height: 1.5;
}

.logout-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.logout-confirm-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, #fed7d7, #feb2b2);
    color: #c53030;
    border: 2px solid #feb2b2;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.logout-confirm-btn:hover {
    background: linear-gradient(135deg, #feb2b2, #fc8181);
    border-color: #e53e3e;
    color: #9b2c2c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.logout-cancel-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    color: var(--text-primary, #2d3748);
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-cancel-btn:hover {
    background: linear-gradient(135deg, #edf2f7, #e2e8f0);
    border-color: var(--text-secondary, #718096);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Popup Notification Styles */
.popup-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10002;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    max-width: 500px;
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
    transition: all 0.3s ease;
    border-left: 4px solid #3b82f6;
}

.popup-notification.success {
    border-left-color: #38a169;
}

.popup-notification.error {
    border-left-color: #ef4444;
}

.popup-notification.info {
    border-left-color: #3b82f6;
}

.popup-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.popup-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
}

.popup-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.popup-notification.success .popup-icon {
    background: rgba(56, 161, 105, 0.1);
    color: #38a169;
}

.popup-notification.error .popup-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.popup-notification.info .popup-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.popup-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    line-height: 1.4;
}

.popup-close {
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    font-size: 16px;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.popup-close:hover {
    color: #718096;
    background: #f7fafc;
}

/* Notification styles for showMessage function */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10002;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
    border-left: 4px solid #3b82f6;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
}

.notification.success {
    border-left-color: #38a169;
}

.notification.error {
    border-left-color: #ef4444;
}

.notification.info {
    border-left-color: #3b82f6;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification span {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    line-height: 1.4;
}

.notification button {
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification button:hover {
    color: #718096;
    background: #f7fafc;
}

/* Error notification styles for invalid credentials */
.auth-error-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    background: var(--error-bg);
    border: 1px solid var(--error-color);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(229, 62, 62, 0.2);
    animation: slideInFromTop 0.3s ease-out;
    min-width: 300px;
    max-width: 500px;
}

.auth-error-notification .error-icon {
    color: var(--error-color);
    font-size: 20px;
    flex-shrink: 0;
}

.auth-error-notification .error-message {
    color: #742a2a;
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.auth-error-notification .error-close {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.auth-error-notification .error-close:hover {
    background: rgba(229, 62, 62, 0.1);
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Profile avatar with initials for users without profile picture */
.profile-initial-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-weight: 600;
    font-size: 16px;
    text-transform: uppercase;
}

.header-user-initial-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-weight: 600;
    font-size: 16px;
    text-transform: uppercase;
    border-radius: 50%;
}

/* Enhanced Validation Popup Styles */
.validation-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 10002;
    min-width: 320px;
    max-width: 450px;
    overflow: hidden;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.validation-popup.show {
    transform: translateX(0);
    opacity: 1;
}

.validation-popup.hiding {
    transform: translateX(100%);
    opacity: 0;
}

.validation-popup-content {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    gap: 12px;
}

.validation-icon {
    flex-shrink: 0;
    font-size: 20px;
    margin-top: 2px;
}

.validation-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #2d3748;
}

.validation-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 16px;
    color: #718096;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.validation-close:hover {
    color: #2d3748;
    background: #f7fafc;
}

.validation-progress-bar {
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.validation-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: currentColor;
    transform: translateX(-100%);
    animation: progress 5s linear forwards;
}

@keyframes progress {
    to {
        transform: translateX(0);
    }
}

/* Validation popup types */
.validation-error {
    border-left: 4px solid #e53e3e;
}

.validation-error .validation-icon {
    color: #e53e3e;
}

.validation-error .validation-progress-bar::before {
    background: #e53e3e;
}

.validation-success {
    border-left: 4px solid #38a169;
}

.validation-success .validation-icon {
    color: #38a169;
}

.validation-success .validation-progress-bar::before {
    background: #38a169;
}

.validation-warning {
    border-left: 4px solid #d69e2e;
}

.validation-warning .validation-icon {
    color: #d69e2e;
}

.validation-warning .validation-progress-bar::before {
    background: #d69e2e;
}

.validation-info {
    border-left: 4px solid #3182ce;
}

.validation-info .validation-icon {
    color: #3182ce;
}

.validation-info .validation-progress-bar::before {
    background: #3182ce;
}

/* Change Password Modal Styles */
.change-password-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.change-password-modal.show {
    opacity: 1;
}

.change-password-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: pointer;
}

.change-password-modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 480px;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.change-password-modal.show .change-password-modal-content {
    transform: scale(1) translateY(0);
}

.change-password-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.change-password-modal-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.change-password-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #718096;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.change-password-close-btn:hover {
    background: #f7fafc;
    color: #2d3748;
}

.change-password-modal-body {
    padding: 24px;
}

.change-password-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.change-password-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.change-password-form label {
    font-weight: 500;
    color: #2d3748;
    font-size: 14px;
}

.change-password-form .password-input {
    position: relative;
}

.change-password-form input[type="password"],
.change-password-form input[type="text"] {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.change-password-form input:focus {
    outline: none;
    border-color: #38a169;
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.1);
}

.change-password-form .password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.change-password-form .password-toggle:hover {
    color: #2d3748;
}

.password-strength {
    font-size: 12px;
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.password-strength.weak {
    color: #e53e3e;
    background: #fed7d7;
}

.password-strength.medium {
    color: #d69e2e;
    background: #fef5e7;
}

.password-strength.strong {
    color: #38a169;
    background: #c6f6d5;
}

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

.change-password-submit-btn {
    background: #38a169;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.change-password-submit-btn:hover {
    background: #2f855a;
    transform: translateY(-1px);
}

.change-password-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.change-password-cancel-btn {
    background: #ffffff;
    color: #718096;
    border: 2px solid #e2e8f0;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.change-password-cancel-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
}

/* Edit Profile Modal Styles */
.edit-profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.edit-profile-modal.show {
    opacity: 1;
}

.edit-profile-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: pointer;
}

.edit-profile-modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 480px;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.edit-profile-modal.show .edit-profile-modal-content {
    transform: scale(1) translateY(0);
}

.edit-profile-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.edit-profile-modal-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-profile-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #718096;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.edit-profile-close-btn:hover {
    background: #f7fafc;
    color: #2d3748;
}

.edit-profile-modal-body {
    padding: 24px;
}

.edit-profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.edit-profile-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-profile-form label {
    font-weight: 500;
    color: #2d3748;
    font-size: 14px;
}

.edit-profile-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.edit-profile-form input:focus {
    outline: none;
    border-color: #38a169;
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.1);
}

.edit-profile-submit-btn {
    background: #38a169;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.edit-profile-submit-btn:hover {
    background: #2f855a;
    transform: translateY(-1px);
}

.edit-profile-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.edit-profile-cancel-btn {
    background: #ffffff;
    color: #718096;
    border: 2px solid #e2e8f0;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.edit-profile-cancel-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
}

/* Loading States */
.auth-loading {
    position: relative;
    pointer-events: none;
}

.auth-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .validation-popup {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        min-width: 0;
    }

    .change-password-modal-content,
    .edit-profile-modal-content {
        margin: 20px;
        width: calc(100% - 40px);
        max-width: none;
    }

    .form-actions {
        flex-direction: column;
        gap: 8px;
    }

    .change-password-submit-btn,
    .change-password-cancel-btn,
    .edit-profile-submit-btn,
    .edit-profile-cancel-btn {
        width: 100%;
        justify-content: center;
    }
}
