/* 
* Magdalena Mikurda - Ebooks Page Styles
* CSS for ebooks section
*/

/* ===== EBOOKS HERO SECTION ===== */
.ebooks-hero {
    height: 60vh;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), 
                linear-gradient(135deg, #ff6b6b, #6b66ff);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    text-align: center;
    color: white;
    padding-top: 80px;
}

/* ===== ALL EBOOKS BUNDLE STYLES ===== */
.all-ebooks-bundle {
    background: linear-gradient(to right, #ffffff, #f9f9f9);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 3rem;
    position: relative;
    border: 2px solid var(--primary-color);
}

.bundle-image {
    width: 300px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    margin-right: 2rem;
    float: left;
    /* A4 aspect ratio container */
    padding-bottom: 424.2px; /* 300px * 1.414 = 424.2px for A4 ratio */
}

.bundle-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    padding: 10px;
}

.grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-left {
    grid-column: 1;
    grid-row: 1;
}

.top-right {
    grid-column: 2;
    grid-row: 1;
}

.bottom-left {
    grid-column: 1;
    grid-row: 2;
}

.bottom-right {
    grid-column: 2;
    grid-row: 2;
}

.center {
    position: absolute;
    width: 50%;
    height: 50%;
    top: 25%;
    left: 25%;
    z-index: 10;
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    background-color: white;
}

.grid-item:hover {
    transform: scale(1.05);
    z-index: 5;
}

.center:hover {
    transform: scale(1.2);
}

.bundle-content {
    position: relative;
    z-index: 2;
    padding: 1rem;
    overflow: hidden;
}

.best-choice-badge {
    position: absolute;
    top: -15px;
    right: -80px;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transform: rotate(45deg) translateX(20px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 3;
    text-align: center;
    width: 240px;
}

.bundle-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.bundle-description {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--gray-color);
    max-width: 80%;
}

.bundle-includes {
    margin-bottom: 1.5rem;
}

.bundle-includes p {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.bundle-includes i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.bundle-pricing {
    margin-bottom: 1.5rem;
}

.regular-price {
    font-size: 1.2rem;
    color: var(--gray-color);
    margin-bottom: 0.2rem;
}

.bundle-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.savings {
    font-size: 1rem;
    color: #28a745;
    font-weight: 600;
}

.btn-bundle {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.2rem;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-bundle:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
    color: white;
}

/* ===== EBOOKS GRID ===== */
/* Ebooks page specific grid - base styles now in styles.css */
.ebooks-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    margin-top: 3rem;
}

/* Ebooks page specific card styling - base styles now in styles.css */
.ebooks .ebook-card {
    background-color: white;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.ebook-image {
    position: relative;
    overflow: hidden;
    /* A4 aspect ratio container */
    padding-bottom: 141.4%; /* A4 ratio (1:1.414) */
}

.ebook-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fill the entire width */
    transition: transform 0.5s ease;
}

/* Hover effect for ebook images */
.ebooks .ebook-card:hover .ebook-image img {
    transform: scale(1.05);
}

.ebook-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 300px;
    position: relative;
    width: 100%;
    justify-content: space-between;
    overflow: visible;
}

.ebook-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.ebook-description {
    color: var(--gray-color);
    margin-bottom: 1.5rem;
}

.ebook-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.btn-buy {
    background: var(--gradient-primary);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    position: relative;
    z-index: 10;
}

.btn-buy:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
    color: white;
}

.btn-details {
    background: transparent;
    color: var(--dark-color);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    display: inline-block;
    transition: all 0.3s ease;
    border: 1px solid var(--gray-color);
    margin-right: 0.5rem;
    position: relative;
    z-index: 10;
}

.btn-details:hover {
    background: var(--light-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.ebook-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    position: relative;
    z-index: 10;
    width: 100%;
    visibility: visible !important;
}

.coming-soon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gradient-secondary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 2;
}

.ebook-image:has(.coming-soon) img {
    filter: blur(10px);
}

/* Fallback for browsers that don't support :has() */
.coming-soon ~ img {
    filter: blur(10px);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 992px) {
    .bundle-description {
        max-width: 100%;
    }
    
    .best-choice-badge {
        transform: rotate(45deg) translateX(30px);
        font-size: 0.9rem;
        padding: 0.4rem 1.2rem;
    }
    
    .bundle-image {
        width: 250px;
        padding-bottom: 353.5px; /* 250px * 1.414 = 353.5px for A4 ratio */
    }
}

@media (max-width: 768px) {
    .ebooks-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .bundle-title {
        font-size: 1.7rem;
    }
    
    .bundle-description {
        font-size: 1rem;
    }
    
    .bundle-includes p {
        font-size: 1rem;
    }
    
    .btn-bundle {
        padding: 0.8rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .bundle-image {
        width: 200px;
        padding-bottom: 282.8px; /* 200px * 1.414 = 282.8px for A4 ratio */
        margin-right: 1.5rem;
    }
}

@media (max-width: 576px) {
    .ebooks-grid {
        grid-template-columns: 1fr;
    }
    
    .all-ebooks-bundle {
        padding: 0.5rem;
    }
    
    .bundle-content {
        padding: 0.5rem;
    }
    
    .ebook-content {
        padding: 1rem;
        min-height: auto;
        overflow: visible;
    }
    
    .best-choice-badge {
        transform: rotate(45deg) translateX(25px);
        font-size: 0.8rem;
        padding: 0.3rem 1rem;
    }
    
    .bundle-title {
        font-size: 1.5rem;
    }
    
    .bundle-price {
        font-size: 1.7rem;
    }
    
    .bundle-image {
        width: 100%;
        padding-bottom: 141.4%; /* 100% width * 1.414 = 141.4% for A4 ratio */
        float: none;
        margin: 0 0 1.5rem 0;
    }
    
    /* Adjust grid for mobile */
    .bundle-grid {
        gap: 5px;
    }
    
    .center {
        width: 60%;
        height: 60%;
        top: 20%;
        left: 20%;
    }
    
    /* Prevent ebook cards from inheriting height in mobile mode */
    .ebook-card {
        height: auto !important;
        margin-bottom: 2rem;
    }
    
    /* Ensure ebook-actions are visible in mobile view */
    .ebook-actions {
        display: flex;
        visibility: visible !important;
        position: relative;
        z-index: 20;
        margin-top: 1rem;
    }
    
    .btn-buy, .btn-details {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}