/* 
   ПРАВИЛЬНОЕ ИСПРАВЛЕНИЕ user-block.css
   Замени ПОЛНОСТЬЮ содержимое файла assets/css/user-block.css
*/

/* 
   Исправленные стили для блока пользователя
   Замените первые 100 строк файла assets/css/user-block.css на эти
*/

/* ========== ОСНОВНОЙ БЛОК ПОЛЬЗОВАТЕЛЯ ========== */
.user-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 26px;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    /* box-shadow: 0 8px 25px rgba(59, 130, 246, 0.06); */
}

.dark-theme .user-card {
    background: rgba(30, 30, 46, 0.9);
}

/* ========== ГРАДИЕНТНАЯ РАМКА ========== */
.user-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: subtract;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: subtract;
    opacity: 0.5;
}

.dark-theme .user-card::before {
    opacity: 0.7;
}

.user-card:hover {
    transform: translateY(-3px);
    /* box-shadow: 0 15px 40px rgba(59, 130, 246, 0.12); */
}

/* ========== ЗАГОЛОВОК С АВАТАРКОЙ ========== */
.user-header {
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    z-index: 1;
}

/* ========== АВАТАРКА ПОЛЬЗОВАТЕЛЯ ========== */
.user-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.7em;
    font-weight: 700;
    /* box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3); */
    transition: all 0.3s ease;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    z-index: 2;
}

.user-avatar.has-emoji {
    font-size: 2.2em;
    font-weight: normal;
}

.user-avatar:hover {
    transform: scale(1.05);
    /* box-shadow: 0 12px 35px rgba(139, 92, 246, 0.4); */
}

/* ========== КНОПКА РЕДАКТИРОВАНИЯ АВАТАРА ========== */
.edit-avatar-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #1e293b;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px !important;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    z-index: 3;
    line-height: 1;
}

.edit-avatar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); */
}

.edit-avatar-btn:active {
    transform: scale(0.95);
}

.dark-theme .edit-avatar-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #1e293b;
}

.dark-theme .edit-avatar-btn:hover {
    background: rgba(255, 255, 255, 0.2);    
}

/* ========== ИНФОРМАЦИЯ ПОЛЬЗОВАТЕЛЯ ========== */
.user-info {
    flex: 1;
}

.user-info-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.user-info h3 {
    font-size: 1.3em;
    font-weight: 700;
    color: #1e293b;
    transition: color 0.3s ease;
    margin: 0;
}

.dark-theme .user-info h3 {
    color: #ffffff;
}

.user-info p {
    color: #64748b;
    font-size: 0.9em;
    transition: color 0.3s ease;
    margin: 0;
}

.dark-theme .user-info p {
    color: #b3b3cc;
}

/* ========== КНОПКА РЕДАКТИРОВАНИЯ ИМЕНИ ========== */
.edit-name-btn {
    background: rgba(139, 92, 246, 0.1);
    border: none;
    color: #8b5cf6;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    margin-left: 12px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    position: relative;
}

.edit-name-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    color: #6366f1;
    transform: scale(1.1);
    /* box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2); */
}

.edit-name-btn:active {
    transform: scale(0.95);
}

.dark-theme .edit-name-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #a78bfa;
}

.dark-theme .edit-name-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #c4b5fd;
}

/* ========== ПОЛЕ ВВОДА ИМЕНИ ========== */
.name-input {
    display: none;
    width: 100%;
    padding: 10px;
    border: 2px solid #8b5cf6;
    border-radius: 10px;
    font-size: 1em;
    margin-top: 8px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
    transition: all 0.3s ease;
}

.dark-theme .name-input {
    background: rgba(42, 42, 62, 0.9);
    color: #ffffff;
    border-color: #8b5cf6;
}

.name-input.active {
    display: block;
    animation: slideDown 0.3s ease;
}

.name-input:focus {
    outline: none;
    border-color: #6366f1;
    /* box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); */
}

/* ========== МОДАЛЬНОЕ ОКНО ВЫБОРА ЭМОДЗИ ========== */
.emoji-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.emoji-modal.active {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

.emoji-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 24px;
    max-width: 90%;
    width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    /* box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); */
    position: relative;
    animation: modalSlideUp 0.3s ease;
}

.dark-theme .emoji-modal-content {
    background: rgba(30, 30, 46, 0.95);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: white;
}

/* Остальные стили остаются без изменений... */

.emoji-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.dark-theme .emoji-modal-header {
    border-bottom-color: rgba(58, 58, 94, 0.5);
}

.emoji-modal-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #1e293b;
}

.dark-theme .emoji-modal-title {
    color: white;
}

.emoji-modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #64748b;
    transition: color 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.emoji-modal-close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ========== ВЫБОР ЦВЕТА И ЭМОДЗИ ========== */
.color-selection {
    margin-bottom: 24px;
}

.color-selection-title,
.emoji-selection-title {
    font-size: 0.95em;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
}

.dark-theme .color-selection-title,
.dark-theme .emoji-selection-title {
    color: #b3b3cc;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(4, min-content);
    gap: 12px;
    margin-bottom: 8px;
    justify-content: space-between;
}

.color-item {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); */
    overflow: hidden;
    background-clip: padding-box, border-box !important;
    background-origin: border-box !important;
}

.color-item:hover {
    transform: scale(1.1);
    /* box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); */
}

.color-item:active {
    transform: scale(0.95);
}

.color-item.selected {
    border-color: #1e293b;
    transform: scale(1);
    animation: selectPulse 0.3s ease;
}

.dark-theme .color-item.selected {
    border-color: white;
}

.color-item.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

@keyframes selectPulse {
    0% { transform: scale(1.05); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1.05); }
}

.emoji-selection {
    padding-top: 20px;
    border-top: 1px solid rgba(226, 232, 240, 0.5);
}

.dark-theme .emoji-selection {
    border-top-color: rgba(58, 58, 94, 0.5);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.emoji-item {
    width: 48px;
    height: 48px;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    transition: all 0.2s ease;
    background: rgba(248, 250, 252, 0.5);
}

.dark-theme .emoji-item {
    background: rgba(42, 42, 62, 0.5);
}

.emoji-item:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
    transform: scale(1.1);
}

.emoji-item.selected {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.2);
}

.remove-avatar-btn {
    width: 100%;
    padding: 12px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.remove-avatar-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* ========== ЦВЕТОВЫЕ КЛАССЫ ДЛЯ АВАТАРКИ ========== */
/* Эти классы применяются к самой аватарке на странице */

.user-avatar.avatar-blue {
    background: linear-gradient(135deg, #86a8df 0%, #274da0 100%);
}

.user-avatar.avatar-purple {
    background: linear-gradient(135deg, #c56be6 0%, #821bb1 100%);
}

.user-avatar.avatar-red {
    background: linear-gradient(135deg, #f27373 0%, #9f1414 100%);
}

.user-avatar.avatar-yellow {
    background: linear-gradient(135deg, #f2e878 0%, #fbbf24 100%);
}

.user-avatar.avatar-green {
    background: linear-gradient(135deg, #5ecfa9 0%, #117858 100%);
}

.user-avatar.avatar-pink {
    background: linear-gradient(135deg, #f26eb0 0%, #890b44 100%);
}

.user-avatar.avatar-indigo {
    background: linear-gradient(135deg, #a5dbe9 0%, #4e9db1 100%);
}

.user-avatar.avatar-orange {
    background: linear-gradient(135deg, #f3c26d 0%, #e26912 100%);
}

/* ========== ЦВЕТОВЫЕ КЛАССЫ ДЛЯ МОДАЛЬНОГО ОКНА ========== */
/* Эти классы для кружочков выбора цвета в модальном окне */

.color-item.color-option-blue {
    background: linear-gradient(135deg, #86a8df 0%, #274da0 100%);
}

.color-item.color-option-purple {
    background: linear-gradient(135deg, #c56be6 0%, #821bb1 100%);
}

.color-item.color-option-red {
    background: linear-gradient(135deg, #f27373 0%, #9f1414 100%);
}

.color-item.color-option-yellow {
    background: linear-gradient(135deg, #f2e878 0%, #fbbf24 100%);
}

.color-item.color-option-green {
    background: linear-gradient(135deg, #5ecfa9 0%, #117858 100%);
}

.color-item.color-option-pink {
    background: linear-gradient(135deg, #f26eb0 0%, #890b44 100%);
}

.color-item.color-option-indigo {
    background: linear-gradient(135deg, #a5dbe9 0%, #4e9db1 100%);
}

.color-item.color-option-orange {
    background: linear-gradient(135deg, #f3c26d 0%, #e26912 100%);
}

/* ========== АНИМАЦИИ ========== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from { 
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 480px) {
    .user-card {
        padding: 20px;
        margin-bottom: 16px;
    }
    
    .user-header {
        gap: 15px;
    }
    
    .user-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.4em;
    }
    
    .user-avatar.has-emoji {
        font-size: 2em;
    }
    
    .edit-avatar-btn {
        width: 20px;
        height: 20px;
        font-size: 10px !important;
    }
    
    .user-info h3 {
        font-size: 1.1em;
    }
    
    .user-info p {
        font-size: 0.85em;
    }
    
    .edit-name-btn {
        width: 28px;
        height: 28px;
        font-size: 0.9em;
        margin-left: 8px;
    }
    
    .emoji-modal-content {
        width: 95%;
        padding: 20px;
        max-height: 85vh;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .emoji-item {
        width: 44px;
        height: 44px;
        font-size: 1.6em;
    }
    
    .color-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
}

@media (max-width: 320px) {
    .user-card {
        padding: 16px;
        border-radius: 16px;
    }
    
    .user-header {
        gap: 12px;
    }
    
    .user-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.2em;
    }
    
    .user-avatar.has-emoji {
        font-size: 1.8em;
    }
    
    .edit-avatar-btn {
        width: 18px;
        height: 18px;
        font-size: 9px !important;
    }
    
    .user-info h3 {
        font-size: 1em;
    }
    
    .user-info p {
        font-size: 0.8em;
    }
    
    .edit-name-btn {
        width: 24px;
        height: 24px;
        font-size: 0.8em;
        margin-left: 6px;
    }
    
    .color-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}
