/* E-booki Page Specific Styles */

.ebooki-page {
    background: var(--primary-color);
}

/* Header Solid Background */
.header-solid {
    position: fixed;
    background: rgba(10, 10, 10, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-solid .nav-list a.active {
    color: rgb(255, 125, 0);
}

.header-solid .nav-list a.active::after {
    width: 100%;
    background: rgb(255, 125, 0);
}

/* Main Library Layout */
.library-main {
    min-height: 100vh;
    padding-top: 82px;
    background: var(--primary-color);
}

/* Library Header */
.library-header {
    padding: 4rem 0 3rem;
    background: linear-gradient(135deg, rgba(255, 125, 0, 0.05) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.library-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
    text-align: center;
}

.library-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.library-subtitle {
    font-size: 1.2rem;
    color: var(--text-gray);
    margin-bottom: 3rem;
    font-weight: 300;
}

/* Library Search */
.library-search {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1.5rem;
    color: var(--text-gray);
    pointer-events: none;
}

.library-search-input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3.5rem;
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.library-search-input:focus {
    outline: none;
    border-color: rgb(255, 125, 0);
    background: rgba(40, 40, 40, 0.9);
    box-shadow: 0 0 0 3px rgba(255, 125, 0, 0.1);
}

.library-search-input::placeholder {
    color: var(--text-gray);
}

/* Topic filters (Nauczania page) */
.library-topic-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.library-topic-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-gray);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.25s ease;
    font-family: 'Montserrat', sans-serif;
}

.library-topic-btn:hover {
    background: rgba(255, 125, 0, 0.1);
    border-color: rgb(255, 125, 0);
    color: rgb(255, 125, 0);
}

.library-topic-btn.active {
    background: rgba(255, 125, 0, 0.2);
    border-color: rgb(255, 125, 0);
    color: rgb(255, 125, 0);
}

/* Library Container */
.library-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 3rem 6rem;
}

/* Category Filter */
.library-categories {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.library-category-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-gray);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 30px;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.library-category-btn:hover {
    background: rgba(255, 125, 0, 0.1);
    border-color: rgb(255, 125, 0);
    color: rgb(255, 125, 0);
}

.library-category-btn.active {
    background: rgb(255, 125, 0);
    border-color: rgb(255, 125, 0);
    color: #ffffff;
}

/* Library Grid – tiles fit content height, no empty space at bottom */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
    align-items: start;
}


/* E-book Card */
.ebook-card {
    background: rgba(30, 30, 30, 0.5);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.4s ease;
    cursor: pointer;
}

a.ebook-card,
.ebook-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Link cards: taller image area so thumbnail has more space */
.ebook-card-link .ebook-cover {
    padding-top: 85%;
}

.ebook-card-link .ebook-cover img {
    object-fit: cover;
    object-position: center;
}

/* Link cards: fixed info height so all link tiles same size, no gap, image unchanged */
.ebook-card-link .ebook-info {
    padding: 0.5rem 0.75rem;
    height: 6rem;
    min-height: 6rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Link cards: show full title (no truncation) */
.ebook-card-link .ebook-title {
    -webkit-line-clamp: unset;
    overflow: visible;
    display: block;
}

/* Link cards: one space between date and spans, no space under spans */
.ebook-card-link .ebook-author,
.ebook-card-link .podcast-upload-date {
    margin-bottom: 0.25rem;
}
.ebook-card-link .ebook-meta {
    margin-bottom: 0;
}

.ebook-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    background: rgba(40, 40, 40, 0.7);
}

.ebook-cover {
    position: relative;
    width: 100%;
    padding-top: 140%;
    overflow: hidden;
    background: rgba(20, 20, 20, 0.8);
}

.ebook-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.3s ease;
}

.ebook-card:hover .ebook-cover img {
    transform: scale(1.05);
    filter: brightness(0.7);
}

/* Overlay */
.ebook-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ebook-card:hover .ebook-overlay {
    opacity: 1;
}

.btn-download {
    padding: 1rem 2rem;
    background: rgb(255, 125, 0);
    border: none;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-download:hover {
    background: rgb(230, 110, 0);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 125, 0, 0.3);
}

/* E-book Info – image stays as is */
.ebook-info {
    padding: 0.5rem 0.75rem;
}

.ebook-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.15rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.ebook-card:hover .ebook-title {
    color: rgb(255, 125, 0);
}

.ebook-author,
.podcast-upload-date {
    font-size: 0.75rem;
    color: var(--text-gray);
    margin-bottom: 0.2rem;
    font-weight: 400;
}

.ebook-meta {
    display: flex;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: var(--text-gray);
}

.ebook-meta span {
    padding: 0.15rem 0.4rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 968px) {
    .library-main {
        padding-top: 80px;
    }

    .library-header {
        padding: 3rem 0 2rem;
    }

    .library-header-content {
        padding: 0 2rem;
    }

    .library-title {
        font-size: 2.2rem;
    }

    .library-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .library-container {
        padding: 3rem 2rem 4rem;
    }

    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .library-main {
        padding-top: 66px;
    }

    .library-header {
        padding: 2rem 0 1.5rem;
    }

    .library-header-content {
        padding: 0 1rem;
    }

    .library-title {
        font-size: 1.8rem;
    }

    .library-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .library-search-input {
        padding: 0.875rem 1.25rem 0.875rem 3rem;
        font-size: 0.9rem;
    }

    .search-icon {
        left: 1.25rem;
    }

    .library-container {
        padding: 2rem 1rem 3rem;
    }

    .library-categories {
        gap: 0.75rem;
    }

    .library-category-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }

    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1.5rem;
    }

    .ebook-info {
        padding: 0.5rem 0.75rem;
    }

    .ebook-title {
        font-size: 0.9rem;
    }

    .ebook-author,
    .podcast-upload-date {
        font-size: 0.75rem;
    }

    .btn-download {
        padding: 0.75rem 1.5rem;
        font-size: 0.8rem;
    }
}

/* Uwielbienie video modal */
.uwielbienie-video-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.uwielbienie-video-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.uwielbienie-video-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.uwielbienie-video-modal-content {
    position: relative;
    width: 100%;
    max-width: 1000px;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.uwielbienie-video-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    z-index: 10;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.uwielbienie-video-modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.uwielbienie-video-modal-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.uwielbienie-video-modal-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

