/**
 * Style CSS dla frontendu Download Center
 */

/* Reset i podstawowe style */
.dc-download-center {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    margin-bottom: 2rem;
}

.dc-download-center * {
    box-sizing: border-box;
}

/* Sekcja wyszukiwania */
.dc-search-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

.dc-search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.dc-search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.dc-search-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.dc-search-btn {
    padding: 12px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease;
    min-width: 120px;
}

.dc-search-btn:hover {
    background: #005a87;
}

.dc-search-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Filtry */
.dc-filters {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.dc-category-filter,
.dc-manufacturer-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dc-category-filter label,
.dc-manufacturer-filter label {
    font-weight: 600;
    color: #555;
}

.dc-category-select,
.dc-manufacturer-select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 180px;
    transition: all 0.2s ease;
    cursor: pointer;
}

/* Aktywne filtry */
.dc-category-select:not([value=""]):not(:empty),
.dc-manufacturer-select:not([value=""]):not(:empty),
.dc-category-select[data-active="true"],
.dc-manufacturer-select[data-active="true"] {
    border-color: #0073aa;
    background: #f0f8ff;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.dc-search-input:not(:placeholder-shown) {
    border-color: #0073aa;
    background: #f0f8ff;
}

/* Przycisk wyczyść filtry */
.dc-clear-filters {
    padding: 8px 16px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.dc-clear-filters:hover {
    background: #d32f2f;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.3);
}

.dc-clear-filters:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(244, 67, 54, 0.3);
}

.dc-clear-filters:focus {
    outline: 2px solid #f44336;
    outline-offset: 2px;
}

/* Wskaźnik aktywnego tagu */
.dc-search-input.dc-active-tag {
    border-color: #4caf50;
    background: #f1f8e9;
    font-weight: 600;
}

.dc-search-input.dc-active-tag::placeholder {
    color: #4caf50;
    opacity: 0.8;
}

/* Kontener plików */
.dc-files-container {
    position: relative;
}

.dc-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dc-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: dc-spin 1s linear infinite;
}

@keyframes dc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Siatka plików */
.dc-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Element pliku */
.dc-file-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.dc-file-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #0073aa;
}

.dc-file-icon {
    text-align: center;
    margin-bottom: 1rem;
}

.dc-file-icon .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #0073aa;
}

.dc-file-content {
    margin-bottom: 1.5rem;
}

.dc-file-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.dc-file-description {
    margin: 0 0 1rem 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.dc-file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.dc-file-meta span {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    color: #666;
    font-weight: 500;
}

.dc-file-size {
    background: #e3f2fd !important;
    color: #1976d2 !important;
}

.dc-file-type {
    background: #f3e5f5 !important;
    color: #7b1fa2 !important;
}

.dc-file-category {
    background: #e8f5e8 !important;
    color: #388e3c !important;
}

.dc-file-manufacturer {
    background: #fff3e0 !important;
    color: #f57c00 !important;
}

/* Tagi */
.dc-file-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dc-tag {
    background: #0073aa;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    user-select: none;
}

.dc-tag:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3);
}

.dc-tag:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 115, 170, 0.3);
}

.dc-tag:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Przycisk rozwijania tagów */
.dc-tag-expand {
    background: #6c757d !important;
    color: white !important;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    user-select: none;
}

.dc-tag-expand:hover {
    background: #5a6268 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

.dc-tag-expand:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(108, 117, 125, 0.3);
}

.dc-tag-expand:focus {
    outline: 2px solid #6c757d;
    outline-offset: 2px;
}

/* Ukryte tagi */
.dc-tags-hidden {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    animation: dc-fadeIn 0.3s ease-in;
}

.dc-tags-hidden .dc-tag {
    animation: dc-fadeIn 0.3s ease-in;
}

/* Akcje pliku */
.dc-file-actions {
    border-top: 1px solid #f0f0f0;
    padding-top: 1rem;
    margin-top: 1rem;
}

.dc-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #0073aa;
    color: white !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.dc-download-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.dc-download-btn:active {
    transform: translateY(0);
}

.dc-download-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.dc-download-info {
    text-align: center;
}

.dc-download-count {
    font-size: 0.8rem;
    color: #666;
}

/* Brak wyników */
.dc-no-results,
.dc-no-files {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
    font-style: italic;
}

.dc-no-results p,
.dc-no-files {
    margin: 0;
    font-size: 1.1rem;
}

/* Infinite scroll i ładowanie */
.dc-load-more {
    text-align: center;
    padding: 2rem 1rem;
}

.dc-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dc-load-more-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

.dc-load-more-btn:active {
    transform: translateY(0);
}

.dc-load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.dc-load-more-btn .dc-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: dc-spin 1s linear infinite;
}

.dc-infinite-loading {
    text-align: center;
    padding: 2rem 1rem;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dc-infinite-loading .dc-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: dc-spin 1s linear infinite;
}

/* Animacje */
.dc-fade-in {
    animation: dc-fadeIn 0.5s ease-in;
}

@keyframes dc-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsywność */
@media (max-width: 768px) {
    .dc-files-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dc-search-form {
        flex-direction: column;
    }
    
    .dc-search-input,
    .dc-search-btn {
        width: 100%;
    }
    
    .dc-filters {
        flex-direction: column;
        gap: 15px;
    }
    
    .dc-category-filter,
    .dc-manufacturer-filter {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .dc-category-select,
    .dc-manufacturer-select {
        width: 100%;
    }
    
    .dc-file-item {
        padding: 1rem;
    }
    
    .dc-file-meta {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .dc-search-section {
        padding: 1rem;
    }
    
    .dc-file-icon .dashicons {
        font-size: 36px;
        width: 36px;
        height: 36px;
    }
    
    .dc-file-title {
        font-size: 1.1rem;
    }
    
    .dc-download-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

/* Focus states dla dostępności */
.dc-search-input:focus,
.dc-category-select:focus,
.dc-manufacturer-select:focus,
.dc-download-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Tryb wysokiego kontrastu */
@media (prefers-contrast: high) {
    .dc-file-item {
        border-width: 2px;
    }
    
    .dc-download-btn {
        border: 2px solid #0073aa;
    }
    
    .dc-tag {
        border: 1px solid #0073aa;
    }
}

/* Reduce motion dla osób wrażliwych na animacje */
@media (prefers-reduced-motion: reduce) {
    .dc-file-item,
    .dc-download-btn,
    .dc-search-input {
        transition: none;
    }
    
    .dc-fade-in {
        animation: none;
    }
    
    .dc-spinner {
        animation: none;
    }
}
