/* ---------------------------------- */
/* ФАЙЛЫ, ДОКУМЕНТЫ, ЗАГРУЗКА        */
/* ---------------------------------- */

.document-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.document-preview:hover {
    background: var(--bg-surface);
}
.document-icon {
    font-size: 32px;
    color: var(--primary);
}
.document-info {
    flex: 1;
}
.document-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    word-break: break-all;
}
.document-actions {
    display: flex;
    gap: 8px;
}
.archive-download-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}
.archive-download-btn:hover {
    background: var(--primary);
    color: white;
}

.text-preview {
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 8px 12px;
    max-width: 400px;
}
.text-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.text-preview-content {
    font-size: 11px;
    font-family: monospace;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
    margin: 0;
    color: var(--text-secondary);
}
.text-preview-loading {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 12px;
}

.file-preview-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 10px 16px;
    min-width: 200px;
}
.file-preview-card .file-icon {
    font-size: 32px;
    color: var(--primary);
}
.file-preview-card .file-info {
    flex: 1;
}
.file-preview-card .file-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    word-break: break-all;
}
.file-preview-card .file-actions {
    display: flex;
    gap: 8px;
}
.file-preview-card .btn-sm {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 20px;
}
.download-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    margin-left: 8px;
    transition: color 0.2s;
    font-size: 14px;
}
.download-btn:hover {
    color: var(--primary);
}

.file-upload-indicator {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.circular-progress {
    animation: pulse 1.5s ease-in-out infinite;
}
.circular-progress svg {
    width: 100%;
    height: 100%;
}
.circle-bg {
    fill: none;
    stroke: var(--bg-elevated);
    stroke-width: 3;
}
.circle-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3;
    transition: stroke-dashoffset 0.2s ease;
    animation: pulse 1.5s ease-in-out infinite;
}
.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
    color: var(--text);
    text-shadow: 0 0 2px rgba(0,0,0,0.5);
}
.file-name {
    font-size: 11px;
    color: var(--text-secondary);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-download-circle {
    width: 48px;
    height: 48px;
    background: var(--bg-elevated);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: relative;
}
.file-download-circle:hover {
    background: var(--primary);
    transform: scale(1.05);
}
.file-download-circle i {
    font-size: 24px;
    color: var(--text);
}
.file-download-circle:hover i {
    color: white;
}
.file-name-tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.file-download-circle:hover .file-name-tooltip {
    opacity: 1;
}
.file-download-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.file-download-name {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-click-effect i {
    animation: iconSpin 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}