/**
 * User Profile Modal Styles
 * Стили для модального окна профиля пользователя
 */

/* Оверлей модального окна */
.user-profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
    opacity: 1;
}

/* Само модальное окно */
.user-profile-modal {
    background: #fff3e0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.3s ease-out;
    position: relative;
}

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

/* Заголовок модального окна */
.user-profile-modal-header {
    display: flex;
    justify-content: flex-end;
    padding: 15px 20px 0;
    position: relative;
}

.user-profile-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s ease;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile-modal-close:hover {
    color: #333;
    background-color: #f5f5f5;
}

/* Тело модального окна */
.user-profile-modal-body {
    padding: 0 30px 30px;
    text-align: center;
}

/* Аватар пользователя */
.user-profile-avatar {
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.user-profile-avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #f0f0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.user-profile-avatar-img:hover {
    transform: scale(1.05);
}

/* Статус пользователя */
.user-profile-status {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    transition: all 0.3s ease;
    position: relative;
}

.status-online .status-indicator {
    background-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
    animation: pulse-online 2s infinite;
}

.status-offline .status-indicator {
    background-color: #9E9E9E;
}

.status-online {
    color: #4CAF50;
}

.status-offline {
    color: #666;
}

/* Анимация пульсации для онлайн статуса */
@keyframes pulse-online {
    0% {
        box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
    }
    100% {
        box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
    }
}

/* Анимация изменения статуса */
.status-changing {
    opacity: 0.6;
    transform: scale(0.95);
}

/* Информация о пользователе */
.user-profile-info {
    margin-bottom: 25px;
}

.user-profile-name {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.user-profile-username {
    font-size: 16px;
    color: #666;
    margin: 0 0 8px 0;
    font-weight: 400;
}

.user-profile-role {
    font-size: 14px;
    color: #888;
    margin: 0;
    padding: 4px 12px;
    background-color: #f5f5f5;
    border-radius: 20px;
    display: inline-block;
    font-weight: 500;
}

/* Действия */
.user-profile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-profile-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
}

.user-profile-btn-primary {
    background-color: #2196F3;
    color: white;
}

.user-profile-btn-primary:hover {
    background-color: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.user-profile-btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.user-profile-btn-secondary:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
    transform: translateY(-1px);
}

.user-profile-btn-outline {
    background-color: transparent;
    color: #333;
    border: 1px solid #333;
}

.user-profile-btn-outline:hover {
    background-color: #333;
    color: white;
    transform: translateY(-1px);
}

.user-profile-btn-success {
    background-color: transparent;
    color: #28a745;
    border: 1px solid #28a745;
    pointer-events: none;
}

.user-profile-btn:active {
    transform: translateY(0);
}

/* Анимации */

/* Адаптивность */
@media (max-width: 480px) {
    .user-profile-modal {
        width: 95%;
        margin: 20px;
    }
    
    .user-profile-modal-body {
        padding: 0 20px 20px;
    }
    
    .user-profile-avatar-img {
        width: 100px;
        height: 100px;
    }
    
    .user-profile-name {
        font-size: 20px;
    }
    
    .user-profile-btn {
        font-size: 14px;
        padding: 10px 16px;
        min-height: 44px;
    }
}

/* Стили для интерактивных имен пользователей */
.chat-username {
    cursor: pointer !important;
    user-select: none !important;
    transition: color 0.2s ease;
    position: relative;
}

.chat-username:hover {
    color: #2196F3 !important;
    text-decoration: underline;
}

.chat-username:active {
    color: #1976D2 !important;
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .user-profile-modal {
        background: #2d2d2d;
        color: #ffffff;
    }
    
    .user-profile-modal-close {
        color: #ccc;
    }
    
    .user-profile-modal-close:hover {
        color: #fff;
        background-color: #404040;
    }
    
    .user-profile-name {
        color: #ffffff;
    }
    
    .user-profile-username {
        color: #ccc;
    }
    
    .user-profile-role {
        background-color: #404040;
        color: #ccc;
    }
    
    .user-profile-btn-secondary {
        background-color: #404040;
        color: #ffffff;
        border-color: #555;
    }
    
    .user-profile-btn-secondary:hover {
        background-color: #505050;
        border-color: #666;
    }
}

/* Дополнительные стили для лучшей интеграции */
.user-profile-modal-overlay * {
    box-sizing: border-box;
}

/* Предотвращение скролла страницы при открытом модальном окне */
body.user-profile-modal-open {
    overflow: hidden;
}

/* Стили для загрузки */
.user-profile-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.user-profile-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Убраны стили для различения своего и чужого профиля */