/* ===== DO POBRANIA - STYLE ===== */

.loonari-downloads-page {
    min-height: 80vh;
    padding: 120px 0 60px;
    background-color: #ffffff;
}

.loonari-downloads-container {
    max-width: 1900px;
    margin: 0 auto;
    padding: 40px 20px; /* Dodane padding boczne */
}

/* ===== NAGŁÓWEK ===== */

.loonari-downloads-header {
    margin-bottom: 40px;
    text-align: center;
    width: 100%; /* Zapewnia pełną szerokość */
}

.loonari-downloads-title {
    font-size: 32px;
    font-weight: 500;
    margin: 0 !important; /* Wyśrodkowanie */
    color: #333;
    text-align: center !important; /* Wymusza wyśrodkowanie */
    width: 100%; /* Pełna szerokość */
}

/* ===== LAYOUT ===== */

.loonari-downloads-content {
    display: flex;
    gap: 60px;
    align-items: flex-start; /* Wyrównanie do góry */
}

/* ===== SIDEBAR - KATEGORIE ===== */

.loonari-downloads-sidebar {
    flex: 0 0 300px;
    background-color: #ffffff;
}

.loonari-sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.loonari-downloads-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.loonari-tree-item {
    margin-bottom: 0;
}

.loonari-tree-link-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;

}

.loonari-tree-link {
    display: block;
    text-decoration: none;
    padding: 12px 0;
    color: #666 !important;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    flex-grow: 1;
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.loonari-tree-link:hover,
.loonari-tree-link.active {
    color: #000;
    font-weight: 600;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

.loonari-tree-link:focus,
.loonari-tree-link:focus-visible {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* ===== USUWANIE OUTLINE ===== */

.loonari-tree-link,
.loonari-tree-link:focus,
.loonari-tree-link:focus-visible,
.loonari-tree-link:hover,
.loonari-tree-link:active {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

a:focus-visible, 
button:focus-visible {
    outline: none !important;
}

/* ===== IKONY KATEGORII ===== */

.loonari-category-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    opacity: 1;
    transition: opacity 0.3s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.loonari-tree-item.active .loonari-category-icon {
    opacity: 1;
}

/* ===== GŁÓWNA SEKCJA ===== */

.loonari-downloads-main {
    flex: 1;
    background-color: #ffffff;
    width: 100%; /* Pełna szerokość */
}

.loonari-downloads-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px; /* Przywrócone oryginalne odstępy */
    align-items: start;
    width: 100%;
}

/* ===== ELEMENTY GRIDU - WIĘKSZE OBRAZY ===== */

.loonari-download-item {
    background-color: #ffffff;
    border: none;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    width: 100%;
}

.loonari-download-cover {
    position: relative;
    width: 100%;
    background-color: #ffffff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1/1; /* Zwiększony stosunek wysokości do szerokości */
}

.loonari-download-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Zmienione z contain na cover dla lepszego wypełnienia */
    object-position: center; /* Wyśrodkowanie obrazu */
}

.loonari-download-placeholder {
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px; /* Większy tekst placeholder */
    font-weight: 600;
    color: #999999;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.loonari-download-title {
    padding: 15px 0 0 0; /* Zmniejszony padding góra */
    font-size: 1.2rem;
    font-weight: 400;
    color: #333;
    line-height: 1.3;
    flex-grow: 1;
    text-align: center; /* Wyśrodkowanie tytułów */
}

/* ===== KOMUNIKATY ===== */

.loonari-no-downloads {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999999;
    font-size: 18px;
}

/* ===== RESPONSYWNOŚĆ ===== */

@media (max-width: 1400px) {
    .loonari-downloads-content {
        gap: 40px;
    }
    
    .loonari-downloads-sidebar {
        flex: 0 0 250px;
    }
    
    .loonari-downloads-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .loonari-download-cover {
        aspect-ratio: 1/1.1; /* Lekko mniejszy stosunek na średnich ekranach */
    }
}

@media (max-width: 968px) {
    .loonari-downloads-content {
        gap: 30px;
    }
    
    .loonari-downloads-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .loonari-download-cover {
        aspect-ratio: 1/1; /* Kwadratowe na mniejszych ekranach */
    }
}

@media (max-width: 768px) {
    .loonari-downloads-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .loonari-downloads-sidebar {
        flex: none;
        border-bottom: 1px solid #e0e0e0;
        padding-bottom: 30px;
    }
    
    .loonari-downloads-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .loonari-download-title {
        padding: 12px 0 0 0;
        font-size: 14px;
    }
    
    .loonari-downloads-title {
        font-size: 28px; /* Mniejszy tytuł na mobile */
    }
}

@media (max-width: 480px) {
    .loonari-downloads-container {
        padding: 15px 10px;
    }
    
    .loonari-downloads-grid {
        grid-template-columns: 1fr; /* Jedna kolumna na bardzo małych ekranach */
        gap: 20px;
    }
    
    .loonari-download-title {
        padding: 12px 0 0 0;
        font-size: 15px;
    }
    
    .loonari-download-cover {
        aspect-ratio: 1/1.1; /* Nieco wyższy na mobile */
    }
    
    .loonari-downloads-title {
        font-size: 24px;
    }
}

/* ===== ANIMACJE ===== */

.loonari-download-item {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.loonari-download-item.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* ===== ŁADOWANIE ===== */

.loonari-downloads-grid.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loonari-downloads-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

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

/* ===== DODATKOWE ULEPSZENIA ===== */

/* Lepsza czytelność tytułów */
.loonari-download-title {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Maksymalnie 2 linie */
    -webkit-box-orient: vertical;
    min-height: 2.6em; /* Stała wysokość dla wyrównania */
}

