/* Upload стили */

/* Область загрузки */
.drop-zone {
    border: 2px dashed #adb5bd;
    border-radius: 12px;
    background-color: #f8f9fa;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover {
    border-color: #0d6efd;
    background-color: #f0f7ff;
}

/* Приём файлов на всю страницу: бегущие муравьи по периметру окна */
#page-drop-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    pointer-events: none; /* иначе оверлей перехватит dragleave и начнёт мигать */
    /* зелёная пелена, к краям плотнее — чтобы контент под ней оставался читаемым */
    background: radial-gradient(ellipse at center, rgba(32, 201, 151, 0.07), rgba(32, 201, 151, 0.18));
}

#page-drop-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* SVG-рамка: скруглённые углы, штрихи бегут через stroke-dashoffset */
#page-drop-overlay svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#page-drop-overlay rect {
    x: 2px;
    y: 2px;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    rx: var(--ctr-radius);
    fill: none;
    stroke: #20c997;
    stroke-width: 2.5;
    stroke-dasharray: 8 7;
}

#page-drop-overlay.show rect {
    animation: drop-ants 0.9s linear infinite;
}

@keyframes drop-ants {
    to { stroke-dashoffset: -15; }  /* шаг = сумме dasharray, иначе рывок на стыке цикла */
}

/* Подпись под курсором */
#drop-cursor-hint {
    position: absolute;
    top: 0;
    left: 0;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(33, 37, 41, 0.9);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    will-change: transform;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.drop-zone-icon {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.drop-zone-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.drop-zone-subtitle {
    color: #6c757d;
    font-size: 0.9rem;
}

/* КОНТЕЙНЕР СПИСКА ФАЙЛОВ */
.files-container {
    max-height: none;
    overflow-y: visible;
    padding: 0 !important;
    margin: 0 !important;

    /*background: #f8f9fa;*/

    /*box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);*/
}

/* ЭЛЕМЕНТЫ ФАЙЛОВ */
.file-item {
    padding: 1px;
    margin: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    background: #eeeeee;
    cursor: default;
    transition: background-color 0.2s;
}

/*.file-item:first-child {*/
/*    border-top-left-radius: 8px;*/
/*    border-top-right-radius: 8px;*/
/*}*/

/*.file-item:last-child {*/
/*    border-bottom: none;*/
/*    border-bottom-left-radius: 8px;*/
/*    border-bottom-right-radius: 8px;*/
/*}*/

/* Добавим легкий ховер эффект */
.file-item:hover {
    background-color: #d0d0d0;
}

/* Стили для drag & drop */
.file-item.dragging {
    opacity: 0.5;
}

.file-item.drag-over {
    background-color: #e8f4ff !important;
    border-top: 2px solid #0d6efd !important;
}

.drag-handle {
    cursor: grab !important;
    padding: 2px 4px !important;
    user-select: none !important;
    color: #6c757d !important;
}

.drag-handle:active {
    cursor: grabbing !important;
}

/* Большие галочки */
.file-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.file-info {
    flex-grow: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    font-size: 0.9em;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8em;
}

/* Бейджи PDF/CSV */
.file-type {
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.7em;
    color: white;
    text-transform: uppercase;
}

.file-type.pdf {
    background: #dc3545;
}

.file-type.csv {
    background: #20c997;
}

.file-type.txt {
    background: #6c757d;
}

.file-type.xlsx {
    background: #107c41;
}

.file-size {
    color: #6c757d;
}

.file-remove {
    color: #dc3545;
    cursor: pointer;
    font-size: 0.9em;
    padding: 3px;
    border-radius: 4px;
    flex-shrink: 0;
}

.file-remove:hover {
    background: rgba(220, 53, 69, 0.1);
}

/* Ярко-зеленая кнопка */
.btn-success {
    background-color: #20c997;
    border-color: #20c997;
    font-weight: 500;
}

.btn-success:hover {
    background-color: #1ba87e;
    border-color: #1ba87e;
}

/* Адаптивность */
@media (max-width: 576px) {
    .drop-zone {
        padding: 1.5rem;
    }

    .drop-zone-icon {
        font-size: 2.5rem;
    }

    .file-meta {
        flex-wrap: wrap;
        gap: 6px;
    }

    .file-item {
        padding: 8px 10px;
        gap: 6px;
    }
}


.file-item.dragging {
    opacity: 0.6;
    background-color: #f8f9fa !important;
}

/* Полоска сверху */
.file-item.drag-over-above {
    position: relative;
}

.file-item.drag-over-above::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #0d6efd;
    border-radius: 2px;
    z-index: 5;
}

/* Полоска снизу */
.file-item.drag-over-below {
    position: relative;
}

.file-item.drag-over-below::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #0d6efd;
    border-radius: 2px;
    z-index: 5;
}

/* Улучшаем ручку перетаскивания */
.drag-handle {
    cursor: grab !important;
    padding: 2px 4px !important;
    user-select: none !important;
    color: #6c757d !important;
    margin-right: -8px;
}

.drag-handle:active {
    cursor: grabbing !important;
}



/* Гостевой демо-прогон: бейдж подменённого файла */
.file-demo {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 8px;
    background: #ffc107;
    color: #4a3600;
    font-size: 10px;
    font-weight: 700;
    vertical-align: middle;
}
