/* Document Listing Plugin Styles */

.doclisting-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Filtros */
.doclisting-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 0;
    background: transparent;
    border: none;
    flex-wrap: wrap;
}

.doclisting-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.doclisting-filter-group label {
    font-weight: normal;
    color: #005a87;
    font-size: 14px;
}

.doclisting-select {
    padding: 0px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    min-width: 150px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 30px;
}

.doclisting-select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Loading */
.doclisting-loading {
    text-align: center;
    padding: 40px 20px;
}

.doclisting-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error */
.doclisting-error {
    text-align: center;
    padding: 20px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    margin-bottom: 20px;
}

.doclisting-retry-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.doclisting-retry-btn:hover {
    background: #c82333;
}

/* Info */
.doclisting-info {
    margin-bottom: 15px;
    color: #6c757d;
    font-size: 14px;
}

/* Document List */
.doclisting-results {
    margin-bottom: 20px;
}

.doclisting-document {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

.doclisting-document:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.document-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.document-title {
    margin: 0;
    color: #212529;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    min-width: 200px;
}

.document-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.document-project {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.project-agenda {
    background: #e3f2fd;
    color: #1565c0;
}

.project-observatory {
    background: #f3e5f5;
    color: #7b1fa2;
}

.document-type,
.doc-type-label,
span[data-type] {
    padding: 4px 8px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    background: #fff3e0 !important;
    color: #ef6c00 !important;
    display: inline-block !important;
    border: none !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

.document-downloads {
    color: #6c757d;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.document-abstract {
    margin-bottom: 15px;
    color: #495057;
    line-height: 1.5;
}

.document-abstract p {
    margin: 0;
}

.document-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.doclisting-download-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    background: #005a87 !important;
    color: white !important;
    text-decoration: none !important;
    padding: 10px 16px;
    border-radius: 4px;
    font-weight: 500;
    border: 2px solid #005a87 !important;
    transition: all 0.3s ease !important;
}

.doclisting-download-btn:hover {
    background: transparent !important;
    color: #005a87 !important;
    text-decoration: none !important;
    border: 2px solid #005a87 !important;
}

.doclisting-download-btn:focus {
    background: transparent !important;
    color: #005a87 !important;
    text-decoration: none !important;
    border: 2px solid #005a87 !important;
    outline: none !important;
}

.file-size {
    font-size: 12px;
    opacity: 0.8;
}

.no-file-available {
    color: #dc3545;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 5px;
}

.document-date {
    color: #6c757d;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Pagination */
.doclisting-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.doclisting-page-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.doclisting-page-btn:hover:not(:disabled) {
    background: #005a87;
}

.doclisting-page-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.doclisting-page-info {
    background: #f8f9fa;
    padding: 10px 16px;
    border-radius: 4px;
    font-weight: 600;
    color: #495057;
}

.page-separator {
    margin: 0 5px;
    color: #6c757d;
}

/* No Results */
.doclisting-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.doclisting-no-results h3 {
    margin: 0 0 10px 0;
    color: #495057;
}

.doclisting-no-results p {
    margin: 0;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .doclisting-filters {
        flex-direction: column;
        gap: 15px;
    }
    
    .doclisting-filter-group {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .doclisting-filter-group label {
        min-width: 120px;
        margin-bottom: 0;
    }
    
    .document-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .document-meta {
        width: 100%;
        justify-content: flex-start;
    }
    
    .document-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .doclisting-pagination {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .doclisting-page-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .doclisting-container {
        padding: 0 10px;
    }
    
    .doclisting-document {
        padding: 15px;
    }
    
    .document-title {
        font-size: 16px;
    }
    
    .doclisting-download-btn {
        width: 100%;
        justify-content: center;
    }
}
