#bundle-content-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000000;
    background: rgba(0, 0, 0, 0.75);
    justify-content: center;
    align-items: center;
    padding: 48px 24px;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.flipbook-modal-content {
    background: #fff;
    border-radius: 24px;
    width: 100%;
    max-width: 1500px;
    height: 85vh;
    max-height: 85vh;
    display: flex;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    position: relative;
    transition: transform 0.3s ease;
}

#bundle-content-display {
    flex-basis: 60%;
    background: #fefefe;
    padding: 48px 48px 48px 56px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    box-sizing: border-box;
    overflow-y: auto;
    text-align: left;
    color: #222;
    opacity: 0;
    animation: fadeInContent 0.5s forwards ease-out;
    transition: box-shadow 0.3s ease;
}

@keyframes fadeInContent {
    to {
        opacity: 1;
    }
}

#bundle-content-display:hover {
    box-shadow: 0 0 40px 5px rgba(90, 79, 255, 0.15);
}

#bundle-content-display h3 {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    color: #1e1e1e;
    align-self: flex-start;
}

#bundle-content-display video,
#bundle-content-display iframe {
    width: 100%;
    max-height: 65vh;
    background: #000;
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    border: none;
    outline: none;
    transition: box-shadow 0.3s ease;
}

#bundle-content-display video:hover,
#bundle-content-display iframe:hover {
    cursor: pointer;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

#bundle-content-display p a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #5a4fff;
    font-weight: 600;
    font-size: 17px;
    text-decoration: none;
    transition: color 0.25s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    background-color: rgba(90, 79, 255, 0.1);
    padding: 6px 12px;
    border-radius: 10px;
    box-shadow: 0 0 5px rgba(90, 79, 255, 0.15);
}

#bundle-content-display p a:hover {
    color: #3f3bbd;
    text-decoration: underline;
    background-color: rgba(90, 79, 255, 0.2);
    box-shadow: 0 6px 12px rgba(90, 79, 255, 0.3);
}

#bundle-content-display p a::before {
    content: "";
    width: 22px;
    height: 22px;
    background-size: contain;
    background-repeat: no-repeat;
    display: inline-block;
    flex-shrink: 0;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.15));
}

#bundle-content-display p a:hover::before {
    transform: scale(1.1);
    filter: drop-shadow(0 0 4px rgba(90, 79, 255, 0.6));
}

.bundle-resource-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.bundle-resource-link {
    margin: 0;
    flex: 0 1 auto;
}

.bundle-resource-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bundle-resource-link svg.resource-icon {
    width: 22px;
    height: 22px;
}

#bundle-content-display .bundle-resource-link a::before {
    display: none;
}

.bundle-sidebar {
    flex-basis: 40%;
    background: #f9f9fc;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    overflow-y: auto;
    box-sizing: border-box;
    font-size: 15px;
    color: #555;
    border-left: 1px solid #e5e5e5;
    scrollbar-width: thin;
    scrollbar-color: #bbb transparent;
}

.bundle-sidebar::-webkit-scrollbar {
    width: 6px;
}

.bundle-sidebar::-webkit-scrollbar-thumb {
    background-color: #bbb;
    border-radius: 4px;
}

.bundle-tag-toggle {
    font-size: 14px;
    font-weight: 700;
    color: #2b2b2b;
    background: none;
    border: none;
    padding: 14px 0;
    cursor: pointer;
    text-align: left;
    position: relative;
    transition: color 0.3s ease;
}

.bundle-tag-toggle:hover {
    color: #5a4fff;
}

.bundle-tag-toggle::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    border: solid #2b2b2b;
    border-width: 0 2px 2px 0;
    padding: 6px;
    transition: transform 0.3s ease;
}

.bundle-tag-toggle[aria-expanded="true"]::after {
    transform: translateY(-50%) rotate(-135deg);
}

.bundle-item-button {
    background: #fff;
    color: #2b2b2b;
    font-size: 14px;
    font-weight: 600;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1.5px solid #d6d6f2;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 0 0 #5a4fff;
}

.bundle-item-button:hover {
    background-color: #f0f0ff;
    border-color: #5a4fff;
    box-shadow: inset 0 0 10px 2px #a7a1ff;
}

.bundle-item-button.active {
    background-color: #5a4fff;
    border-color: #403ebf;
    color: #fff;
    box-shadow: 0 0 12px 3px rgba(90, 79, 255, 0.7);
}

.bundle-item-button svg {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0;
    vertical-align: middle;
    display: inline-block;
    margin-right: 8px;
}

#bundle-progress {
    margin-top: auto;
    font-size: 14px;
    color: #888;
    text-align: right;
}

.flipbook-close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 28px;
    color: #444;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: color 0.3s ease;
    z-index: 11;
}

.flipbook-close:hover {
    color: #5a4fff;
}

@media (max-width: 900px) {
    .flipbook-modal-content {
        flex-direction: column;
        height: auto;
        max-height: 90vh;
        border-radius: 20px;
    }

    #bundle-content-display,
    .bundle-sidebar {
        flex-basis: auto;
        width: 100%;
        padding: 28px 24px;
    }

    #bundle-content-display video,
    #bundle-content-display iframe {
        max-height: 30vh;
        border-radius: 14px;
    }

    .bundle-sidebar {
        border-left: none;
        border-top: 1px solid #e5e5e5;
        font-size: 14px;
        max-height: 50vh;
        overflow-y: auto;
    }

    .flipbook-close {
        top: 16px;
        right: 16px;
        font-size: 24px;
    }
}

.bundle-book-embed {
    display: none;
}
