/* =========================================
   استایل‌های پاپ‌آپ (Modal) ورود
   ========================================= */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(49, 27, 94, 0.6);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* مخفی بودن در حالت عادی */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* کلاسی که با جاوا اسکریپت اضافه میشه تا مدال رو نشون بده */
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: #ffffff;
    width: 90%;
    max-width: 400px;
    padding: 35px 30px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    position: relative;
    text-align: center;
    
    /* انیمیشن پرش از پایین */
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-box {
    transform: translateY(0) scale(1);
}

.close-btn {
    position: absolute;
    top: 15px; left: 20px;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #ef233c;
}

.modal-box h2 {
    color: #311b5e;
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 5px;
}

.modal-subtitle {
    font-size: 13px;
    color: #777;
    margin-bottom: 25px;
}

.input-group {
    text-align: right;
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-size: 13px;
    color: #311b5e;
    font-weight: bold;
    margin-bottom: 8px;
    padding-right: 5px;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0d4f5;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    /*background-color: #fcfafg;*/
}

.input-group input:focus {
    border-color: #ffb703;
    box-shadow: 0 0 10px rgba(255, 183, 3, 0.2);
    background-color: #ffffff;
}

.modal-actions {
    text-align: right;
    margin-bottom: 25px;
}

.forgot-pass {
    font-size: 12px;
    color: #5a2e98;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-pass:hover {
    color: #ffb703;
}

.submit-btn {
    width: 100%;
    background-color: #ffb703;
    color: #311b5e;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 183, 3, 0.3);
}

.submit-btn:hover {
    background-color: #ffb703;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 183, 3, 0.4);
}

.signup-link {
    margin-top: 20px;
    font-size: 13px;
    color: #666;
}

.signup-link a {
    color: #311b5e;
    font-weight: bold;
    text-decoration: none;
    margin-right: 5px;
    transition: color 0.3s ease;
}

.signup-link a:hover {
    color: #ffb703;
}


.user-profile-wrapper {
    display: flex;
    align-items: center;
    height: 100%;
    width: 100%;
}
.user-profile-wrapper .username-text {
    font-weight: bold;
    color: #241442;
    flex-grow: 1;
    padding: 0 14px;
    margin-left: 20px;
    white-space: nowrap;
}

.user-profile-wrapper .profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #3498db;
    object-fit: cover;
    flex-shrink: 0;
    box-sizing: border-box;
    margin: -20px;
    display: block;
}

#userProfileBtn {
    position: relative;
    background: transparent;
    border: none;
    padding: 0;
    height: 40px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.user-profile-pill {
    display: flex;
    align-items: center;
    height: 40px;
    background: linear-gradient(135deg, #ffb703, #fb8500);
    border-radius: 50px;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 0 10px rgba(255, 183, 3, 0.5);
    animation: guestPulse 2s ease-in-out infinite;
}

.user-profile-pill .username-text {
    font-weight: bold;
    color: #241442;
    flex-grow: 1;
    padding: 0 14px;
    white-space: nowrap;
}

.user-profile-pill .profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #3498db;
    object-fit: cover;
    flex-shrink: 0;
    box-sizing: border-box;
    margin: 0;
    display: block;
}

.send-btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}