/**
 * Frontend CSS - style dla materiałów na stronie
 */

/* Wrapper główny */
.psl-materials-wrapper {
    margin: 20px 0;
}

/* Grid layout */
.psl-materials-grid {
    display: grid;
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.psl-materials-col-1 {
    grid-template-columns: 1fr;
}

.psl-materials-col-2 {
    grid-template-columns: repeat(2, 1fr);
}

.psl-materials-col-3 {
    grid-template-columns: repeat(3, 1fr);
}

.psl-materials-col-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Pojedynczy materiał */
.psl-material-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.psl-material-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Miniatura */
.psl-material-thumbnail {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 16/9;
}

.psl-material-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.psl-material-item:hover .psl-material-thumbnail img {
    transform: scale(1.05);
}

/* Zawartość */
.psl-material-content {
    padding: 20px;
}

/* Tytuł */
.psl-material-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
}

/* Kategorie */
.psl-material-categories {
    margin: 0 0 15px 0;
}

.psl-material-category {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f0f0;
    color: #555;
    font-size: 12px;
    border-radius: 4px;
    margin-right: 5px;
    margin-bottom: 5px;
}

/* Excerpt */
.psl-material-excerpt {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* Meta informacje */
.psl-material-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
    padding: 15px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
    color: #666;
}

.psl-material-meta > span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.psl-material-meta .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
    color: #999;
}

.psl-material-type {
    font-weight: 600;
    color: #2271b1;
}

.psl-material-downloads.updated {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); color: #2271b1; }
}

/* Przyciski akcji */
.psl-material-actions {
    margin-top: 15px;
}

.psl-material-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: #2271b1;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

.psl-material-download-btn:hover {
    background: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(34, 113, 177, 0.3);
}

.psl-material-download-btn:active {
    transform: translateY(0);
}

.psl-material-download-btn.downloading {
    background: #135e96;
    pointer-events: none;
}

.psl-material-download-btn .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

/* Brak materiałów */
.psl-no-materials {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

/* Responsive */
@media screen and (max-width: 1024px) {
    .psl-materials-col-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .psl-materials-col-3,
    .psl-materials-col-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .psl-materials-grid {
        gap: 20px;
    }
}

@media screen and (max-width: 480px) {
    .psl-materials-col-2,
    .psl-materials-col-3,
    .psl-materials-col-4 {
        grid-template-columns: 1fr;
    }
    
    .psl-material-meta {
        font-size: 12px;
        gap: 10px;
    }
    
    .psl-material-content {
        padding: 15px;
    }
}

/* Dodatkowe style dla dashicons na frontendzie */
.psl-materials-wrapper .dashicons {
    font-family: dashicons;
    display: inline-block;
    line-height: 1;
    font-weight: 400;
    font-style: normal;
    text-decoration: inherit;
    text-transform: none;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Style dla strony z kategoriami */
.materialy-header {
    margin-bottom: 50px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
}

.materialy-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
}

.kategoria-sekcja {
    margin-bottom: 60px;
    scroll-margin-top: 100px;
}

.kategoria-sekcja h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.kategoria-sekcja h2:hover {
    padding-left: 20px;
}

.kategoria-sekcja > p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Separatory między sekcjami */
.kategoria-sekcja + hr {
    margin: 50px auto;
    max-width: 200px;
    border: none;
    border-top: 3px solid #d32f2f;
    opacity: 0.3;
}

/* Animacja wejścia dla sekcji */
.kategoria-sekcja {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Brak materiałów - lepszy styling */
.psl-no-materials {
    padding: 60px 40px;
    text-align: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%);
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    color: #718096;
    font-size: 16px;
}

.psl-no-materials::before {
    content: "📦";
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}
