/* custom.css */

/* ============================================================================
   СТИЛИ ДЛЯ УЛУЧШЕНИЯ UX ЗАГРУЗКИ ФАЙЛОВ/МЕДИА
   ============================================================================ */

/* Контейнер статуса загрузки файла */
.file-upload-status {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    display: none;
    animation: fadeIn 0.3s ease-in;
    transition: all 0.3s ease;
}

.file-upload-status.show {
    display: block;
}

/* Отображение имени файла */
.file-upload-name {
    font-weight: bold;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-upload-name::before {
    content: "✓";
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 14px;
    font-weight: bold;
}

/* Подсказка об отправке */
.file-upload-hint {
    color: #ff9800;
    font-size: 14px;
    margin-top: 8px;
    padding: 8px;
    background: rgba(255, 152, 0, 0.1);
    border-left: 3px solid #ff9800;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-upload-hint::before {
    content: "⚠️";
    font-size: 18px;
}

/* Подсветка кнопки отправки */
.file-upload-highlight {
    animation: pulse 2s infinite;
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.6) !important;
    border: 2px solid #ff9800 !important;
    position: relative;
}

.file-upload-highlight::after {
    content: "👆";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    animation: bounce 1s infinite;
}

/* Прогресс-бар загрузки */
.file-upload-progress {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 15px;
    overflow: hidden;
    display: none;
}

.file-upload-progress.show {
    display: block;
}

.file-upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
    animation: shimmer 2s infinite;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(255, 152, 0, 0.6);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 25px rgba(255, 152, 0, 0.8);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-5px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Улучшение стиля input[type="file"] */
input[type="file"] {
    transition: all 0.3s ease;
    cursor: pointer;
}

input[type="file"]:hover {
    transform: scale(1.02);
}

input[type="file"]:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* Стиль для успешной загрузки */
.file-upload-success {
    background-color: #e8f5e9;
    border: 2px solid #4CAF50;
    color: #2e7d32;
}

/* Стиль для ошибки загрузки */
.file-upload-error {
    background-color: #ffebee;
    border: 2px solid #f44336;
    color: #c62828;
}

.file-upload-error .file-upload-name::before {
    content: "✗";
    background: #f44336;
}

/* Специальные стили для чата/тикетов */
.chat-upload-status {
    margin-top: 10px;
    padding: 12px;
    border-radius: 8px;
    background: #f5f5f5;
    border: 2px solid #4CAF50;
}

.chat-upload-status .file-upload-hint {
    margin-top: 10px;
    font-weight: 500;
}

/* Предпросмотр файлов */
.file-upload-preview {
    margin: 10px 0;
    position: relative;
}

.file-preview-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: block;
    margin: 0 auto;
}

.file-preview-video {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: block;
    margin: 0 auto;
}

.file-preview-icon {
    font-size: 48px;
    text-align: center;
    padding: 20px;
    background: #f0f0f0;
    border-radius: 8px;
    display: inline-block;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Кнопка удаления файла */
.file-upload-remove {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    padding: 0;
}

.file-upload-preview {
    position: relative;
}

.file-upload-remove:hover {
    background: #d32f2f;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.file-upload-status {
    position: relative;
}

/* Позиционирование кнопки удаления для файлов без предпросмотра */
.file-upload-status > .file-upload-remove {
    position: absolute;
    top: 15px;
    right: 15px;
}

/* Позиционирование кнопки удаления внутри предпросмотра */
.file-upload-preview > .file-upload-remove {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Улучшенное отображение для чата */
.chat-upload-status .file-upload-name {
    font-size: 14px;
    margin-bottom: 8px;
}

.chat-upload-status .file-upload-preview {
    margin: 8px 0;
}

/* Адаптивность */
@media (max-width: 768px) {
    .file-upload-hint {
        font-size: 12px;
        padding: 6px;
    }
    
    .file-upload-highlight::after {
        font-size: 20px;
        top: -25px;
    }
    
    .file-preview-image,
    .file-preview-video {
        max-height: 150px;
    }
    
    .file-preview-icon {
        font-size: 36px;
        padding: 15px;
    }
    
    .file-upload-remove {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }
}

/* ============================================================================ */