/* Docs Uploader Styles */

.docs-uploader-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}


/* Фильтры */

.docs-filters {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.docs-filter {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: #2c3e50;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.docs-filter:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.docs-filter:hover {
    border-color: #bdc3c7;
}

.reset-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.reset-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}


/* Сетка документов */

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}


/* Карточка документа */

.document-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    cursor: pointer;
}

.document-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.document-header {
    padding: 16px 20px 0;
}

.document-category {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.doc-type,
.doc-project {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doc-type {
    background: #eceff5;
    color: #53565d;
}

.doc-project {
    background: #eceff5;
    color: #53565d;
}

.document-content {
    padding: 0 20px 16px;
}

.document-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.document-company {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 16px;
}

.document-footer {
    padding: 16px 20px;
    border-top: 1px solid #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
}

.document-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.file-type {
    background: #ff6b6b;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.file-size {
    color: #95a5a6;
    font-size: 12px;
    font-weight: 500;
}

.document-actions {
    display: flex;
    gap: 8px;
}

.btn-download {
    width: 44px;
    height: 44px;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    background: #ffffff;
    color: #666666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

.btn-download:hover {
    border-color: #999999;
    background: #f8f8f8;
    color: #333333;
    transform: none;
}

.btn-download:active {
    transform: scale(0.95);
}

.btn-download svg {
    fill: currentColor;
}


/* Дополнительные элементы карточки */

.document-location {
    margin-top: 8px;
}

.doc-city {
    background: #f8f9fa;
    color: #6c757d;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.document-date {
    font-size: 11px;
    color: #95a5a6;
    margin-top: 8px;
    font-style: italic;
}

.download-count {
    background: #e8f4fd;
    color: #2980b9;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.no-file-message {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}


/* Обновленные стили для кликабельной карточки */


/* Адаптивность для мобильных устройств */

@media (max-width: 600px) {
    .document-actions {
        gap: 8px;
    }
    .btn-download {
        width: 36px;
        height: 36px;
    }
    .btn-download svg {
        width: 16px;
        height: 16px;
    }
    .document-date {
        font-size: 10px;
    }
    .download-count {
        font-size: 9px;
    }
}


/* Загрузчик */

.docs-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.docs-loader p {
    color: #7f8c8d;
    margin: 0;
}


/* Сообщение "не найдено" */

.no-documents {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    font-size: 16px;
    grid-column: 1 / -1;
}


/* Адаптивность */

@media (max-width: 768px) {
    .docs-uploader-container {
        padding: 15px;
    }
    .docs-filters {
        padding: 15px;
        margin-bottom: 20px;
    }
    .filter-row {
        flex-direction: column;
        gap: 12px;
    }
    .filter-group {
        min-width: auto;
        width: 100%;
    }
    .reset-btn {
        width: 100%;
        justify-content: center;
    }
    .documents-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .document-card {
        margin: 0;
    }
    .document-title {
        font-size: 15px;
    }
    .document-footer {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .document-actions {
        align-self: stretch;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .docs-uploader-container {
        padding: 10px;
    }
    .document-header,
    .document-content,
    .document-footer {
        padding-left: 15px;
        padding-right: 15px;
    }
    .document-category {
        gap: 6px;
    }
    .doc-type,
    .doc-project {
        font-size: 11px;
        padding: 3px 10px;
    }
}


/* Анимации появления */

.document-card {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Выделение активных фильтров */

.docs-filter.active {
    border-color: #3498db;
    background-color: #f8fbff;
}


/* Улучшения для доступности */

.docs-filter:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.btn-download:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}


/* Состояние загрузки для карточек */

.document-card.loading {
    opacity: 0.7;
    pointer-events: none;
}


/* Пустое состояние с иконкой */

.no-documents::before {
    content: "📄";
    display: block;
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}


/* Градиентный фон для категорий */

.doc-type.project-type {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.doc-project.special-project {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}