/**
 * Password Change Modal with Interactive Character
 * Modern, engaging UI for password changes
 */

/* ========================================
   MODAL OVERLAY & CONTAINER
   ======================================== */

/* No backdrop-filter - Safari/iOS blur overlay bug */
.password-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.password-modal {
    background: #ffffff;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.password-modal-overlay.active .password-modal {
    transform: scale(1) translateY(0);
}

/* ========================================
   MODAL HEADER
   ======================================== */

.password-modal-header {
    padding: 2rem 2rem 1rem 2rem;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
}

.password-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    color: #6b7280;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-modal-close:hover {
    background: #e5e7eb;
    color: #374151;
    transform: none; /* Prevent rotation on hover */
}

.password-modal-close i {
    transform: none !important; /* Prevent icon rotation */
}

.password-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.password-modal-subtitle {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
}

/* ========================================
   INTERACTIVE CHARACTER
   ======================================== */

.password-character {
    padding: 2rem 2rem 1rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.character-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.character-face {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: #fff;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

/* Character Eyes */
.character-eyes {
    display: flex;
    gap: 20px;
    margin-top: -10px;
}

.character-eye {
    width: 12px;
    height: 12px;
    background: #374151;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
}

.character-eye::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
}

/* Eye States */
.character-avatar.typing .character-eye {
    animation: blink 3s infinite;
}

.character-avatar.peeking .character-eye {
    transform: translateY(-3px);
}

.character-avatar.hidden .character-eye {
    width: 2px;
    height: 2px;
}

.character-avatar.strong .character-eye {
    transform: scale(1.2);
}

@keyframes blink {
    0%, 45%, 55%, 100% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(0.1);
    }
}

/* Character Mouth */
.character-mouth {
    width: 30px;
    height: 15px;
    border: 2px solid #374151;
    border-top: none;
    border-radius: 0 0 30px 30px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.character-avatar.happy .character-mouth {
    width: 35px;
    height: 18px;
    border-color: #10b981;
}

.character-avatar.worried .character-mouth {
    border-radius: 30px 30px 0 0;
    border-top: 2px solid #f59e0b;
    border-bottom: none;
    margin-top: 5px;
}

.character-avatar.sad .character-mouth {
    border-radius: 30px 30px 0 0;
    border-top: 2px solid #ef4444;
    border-bottom: none;
    margin-top: 5px;
}

/* Hands for peeking */
.character-hands {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.character-hand {
    position: absolute;
    width: 30px;
    height: 30px;
    background: #fbbf24;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
}

.character-hand.left {
    top: 50%;
    left: -10px;
    transform: translateY(-50%);
}

.character-hand.right {
    top: 50%;
    right: -10px;
    transform: translateY(-50%);
}

.character-avatar.peeking .character-hand {
    opacity: 1;
}

.character-avatar.peeking .character-hand.left {
    left: 10px;
}

.character-avatar.peeking .character-hand.right {
    right: 10px;
}

/* Character Message */
.character-message {
    padding: 0.75rem 1rem;
    background: #f3f4f6;
    border-radius: 12px;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    max-width: 80%;
    position: relative;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.character-message.visible {
    opacity: 1;
    transform: translateY(0);
}

.character-message::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #f3f4f6;
}

/* ========================================
   FORM FIELDS
   ======================================== */

.password-modal-body {
    padding: 1.5rem 2rem 2rem 2rem;
}

/* Style Symfony form inputs in modal */
#modalPasswordInputsContainer {
    width: 100%;
}

#modalPasswordInputsContainer .col-md-6 {
    width: 100%;
    padding: 0;
    margin-bottom: 1.5rem;
}

#modalPasswordInputsContainer .form-group {
    margin-bottom: 0;
}

#modalPasswordInputsContainer .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    color: #111827;
    transition: all 0.2s ease;
}

#modalPasswordInputsContainer .form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#modalPasswordInputsContainer .form-control.error {
    border-color: #ef4444;
}

#modalPasswordInputsContainer .form-control.success {
    border-color: #10b981;
}

#modalPasswordInputsContainer label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

#modalPasswordInputsContainer .form-md-line-input {
    padding: 0;
    margin-bottom: 1.5rem;
}

.password-field-group {
    margin-bottom: 1.5rem;
}

.password-field-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.password-field-wrapper {
    position: relative;
}

.password-field-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    color: #111827;
    transition: all 0.2s ease;
}

.password-field-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.password-field-input.error {
    border-color: #ef4444;
}

.password-field-input.success {
    border-color: #10b981;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.125rem;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #374151;
}

/* ========================================
   PASSWORD STRENGTH INDICATOR
   ======================================== */

.password-strength {
    margin-top: 0.75rem;
}

.password-strength-bars {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.password-strength-bar {
    flex: 1;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.password-strength-bar.filled {
    background: #ef4444;
}

.password-strength.weak .password-strength-bar:nth-child(1).filled {
    background: #ef4444;
}

.password-strength.medium .password-strength-bar:nth-child(-n+2).filled {
    background: #f59e0b;
}

.password-strength.good .password-strength-bar:nth-child(-n+3).filled {
    background: #3b82f6;
}

.password-strength.strong .password-strength-bar.filled {
    background: #10b981;
}

.password-strength-text {
    font-size: 0.8125rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

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

.password-strength.good .password-strength-text {
    color: #3b82f6;
}

.password-strength.strong .password-strength-text {
    color: #10b981;
}

/* ========================================
   REQUIREMENTS CHECKLIST
   ======================================== */

.password-requirements {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 12px;
}

.password-requirements-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

.password-requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

.password-requirement-icon {
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    transition: all 0.2s ease;
}

.password-requirement.met {
    color: #10b981;
}

.password-requirement.met .password-requirement-icon {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

/* ========================================
   MODAL FOOTER
   ======================================== */

.password-modal-footer {
    padding: 1.5rem 2rem 2rem 2rem;
    display: flex;
    gap: 1rem;
}

.password-modal-button {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.password-modal-button-cancel {
    background: #f3f4f6;
    color: #374151;
}

.password-modal-button-cancel:hover {
    background: #e5e7eb;
}

.password-modal-button-save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.password-modal-button-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.password-modal-button-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 640px) {
    .password-modal {
        max-width: 100%;
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .character-avatar {
        width: 100px;
        height: 100px;
    }
    
    .password-modal-footer {
        flex-direction: column;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.character-avatar.shake {
    animation: shake 0.5s ease;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

.character-avatar.celebrate {
    animation: bounce 0.6s ease;
}

/* ========================================
   REGISTRATION MODAL INPUTS
   ======================================== */

.password-input-group {
    margin-bottom: 1.25rem;
}

.password-input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.password-input-group label i {
    color: #667eea;
    margin-right: 0.375rem;
}

.password-input-wrapper {
    position: relative;
}

.modal-password-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    color: #111827;
    transition: all 0.2s ease;
}

.modal-password-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-password-input.error {
    border-color: #ef4444;
}

.modal-password-input.success {
    border-color: #10b981;
}

.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

.password-toggle-btn:hover {
    color: #374151;
}

.password-match-status {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    min-height: 1.25rem;
    transition: all 0.2s ease;
}

.password-match-status.match {
    color: #10b981;
}

.password-match-status.mismatch {
    color: #ef4444;
}

.password-match-status i {
    margin-right: 0.375rem;
}

