* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
}

body {
    background: #000000;
    color: #ffffff;
}

.container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    overflow: hidden;
}

.background-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 1;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.second-background {
    opacity: 0;
    z-index: 2;
}

.video-silhouette {
    position: absolute;
    width: min(540px, 96vh * 9/16);
    height: min(960px, 96vh);
    background: #000000;
    border-radius: 12px;
    z-index: 5;
    transition: opacity 0.3s ease;
}

.play-button {
    position: relative;
    width: 120px;
    height: 120px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
}

.play-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.play-button:active {
    transform: scale(0.98);
}

.play-button svg {
    width: 36px;
    height: 36px;
    margin-left: 4px;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.play-button:hover svg {
    opacity: 1;
}

.control-button {
    position: fixed;
    top: 30px;
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
}

.control-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.control-button:active {
    transform: scale(0.95);
}

.control-button svg {
    width: 20px;
    height: 20px;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.control-button:hover svg {
    opacity: 1;
}

.restart-button {
    right: 90px;
}

.fullscreen-toggle {
    right: 30px;
}

.fullscreen-exit {
    display: none;
}

:fullscreen .fullscreen-enter,
:-webkit-full-screen .fullscreen-enter,
:-moz-full-screen .fullscreen-enter {
    display: none;
}

:fullscreen .fullscreen-exit,
:-webkit-full-screen .fullscreen-exit,
:-moz-full-screen .fullscreen-exit {
    display: block;
}

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.video-overlay.active {
    opacity: 1;
    visibility: visible;
}

.video-overlay video {
    border-radius: 12px;
    _box-shadow: 0 20px 60px rgba(0, 0, 0, 0);
    width: min(540px, 96vh * 9/16);
    height: min(960px, 96vh);
    object-fit: contain;
    background: #000000 !important;
}

/* Ensure video stays black during all loading states */
.video-overlay video:empty,
.video-overlay video[src=""],
.video-overlay video:not([src]) {
    background: #000000 !important;
}

/* Override any DASH.js default backgrounds */
.video-overlay video::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000000;
    z-index: -1;
}

.video-loading-cover {
    position: absolute;
    width: min(540px, 96vh * 9/16);
    height: min(960px, 96vh);
    background: #000000;
    border-radius: 12px;
    z-index: 2;
    transition: opacity 0.3s ease;
    pointer-events: none;
    opacity: 0;
}

.close-button {
    position: absolute;
    top: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #ffffff;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.close-button:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .play-button {
        width: 100px;
        height: 100px;
    }

    .play-button svg {
        width: 30px;
        height: 30px;
    }

    .video-silhouette {
        width: min(90vw, 96vh * 9/16);
        height: min(96vh, 90vw * 16/9);
    }

    .video-overlay video {
        width: min(45vw, 90vh * 9/16);
        height: min(90vh, 45vw * 16/9);
    }

    .video-loading-cover {
        width: min(45vw, 90vh * 9/16);
        height: min(90vh, 45vw * 16/9);
    }

    .close-button {
        top: 20px;
        left: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .control-button {
        top: 20px;
        width: 45px;
        height: 45px;
    }

    .control-button svg {
        width: 18px;
        height: 18px;
    }

    .restart-button {
        right: 75px;
    }

    .fullscreen-toggle {
        right: 20px;
    }
}

@media (max-width: 480px) {
    .play-button {
        width: 80px;
        height: 80px;
    }

    .play-button svg {
        width: 24px;
        height: 24px;
    }

    .video-silhouette {
        width: min(90vw, 96vh * 9/16);
        height: min(96vh, 90vw * 16/9);
    }

    .video-overlay video {
        width: min(90vw, 85vh * 9/16);
        height: min(85vh, 90vw * 16/9);
    }

    .video-loading-cover {
        width: min(90vw, 85vh * 9/16);
        height: min(85vh, 90vw * 16/9);
    }

    .control-button {
        top: 15px;
        width: 40px;
        height: 40px;
    }

    .control-button svg {
        width: 16px;
        height: 16px;
    }

    .restart-button {
        right: 65px;
    }

    .fullscreen-toggle {
        right: 15px;
    }

    .close-button {
        top: 15px;
        left: 15px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* Call to Action Buttons */
.cta-container {
    position: absolute;
    display: flex;
    gap: 40px;
    z-index: 8;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) translateY(20px);
    pointer-events: none;
}

.cta-container.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) translateY(0);
}

.cta-ebook { transform: translateX(-30%); }
.cta-paperback { transform: translateX(30%); }

@media (max-width: 600px) {
    .cta-ebook { transform: translateY(-60%); }
    .cta-paperback { transform: translateY(60%); }
}

@media (max-width: 768px) {
    .cta-ebook { transform: translateY(-60%); }
    .cta-paperback { transform: translateY(60%); }
}

.cta-button {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #ffffff;
    padding: 20px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 200px;
    text-align: center;
    pointer-events: all;
}

.cta-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.cta-button:active {
    transform: translateY(0);
}

.cta-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cta-subtitle {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 400;
    line-height: 1.3;
}

.cta-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
}


/* Region Selector Modal */
.region-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.region-modal[style*="display: none"] {
    display: none !important;
}

.region-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.region-modal-content {
    position: relative;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 40px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
}

.region-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
    font-weight: 300;
    line-height: 1;
}

.region-modal-close:hover {
    color: lightblue;
}

.region-modal-title {
    font-family: 'Roboto', sans-serif;
    font-size: 28px;
    font-weight: 500;
    color: #fff;
    margin: 0 0 10px 0;
    text-align: center;
}

.region-modal-subtitle {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 30px 0;
    text-align: center;
}

.region-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.region-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.region-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.region-option:hover .region-name {
    color: orange;
}

.region-flag {
    width: 20px;
    height: auto;
    border-radius: 2px;
}

.region-name {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #fff !important;
}

@media (max-width: 600px) {
    .region-modal-content {
        padding: 30px 20px;
    }
    .region-grid {
        grid-template-columns: 1fr;
    }
    .region-modal-title {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .cta-container {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }

    .cta-button {
        min-width: 200px;
        padding: 16px 24px;
        margin: 0 !important;
    }

    .cta-title {
        font-size: 14px;
    }

    .cta-subtitle {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .cta-button {
        min-width: 180px;
        padding: 14px 20px;
    }

    .popover-content {
        padding: 20px;
        max-width: 300px;
    }

    .popover-content h3 {
        font-size: 16px;
    }
}

.carousel-row {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
}

.carousel-slot {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: all;
    transition: transform 0.52s cubic-bezier(0.4,0,0.2,1),
                width 0.52s cubic-bezier(0.4,0,0.2,1),
                height 0.52s cubic-bezier(0.4,0,0.2,1),
                z-index 0s linear 0.26s,
                opacity 0.52s ease;
}

.carousel-slot.is-centre { opacity: 1; }
.carousel-slot:not(.is-centre) { opacity: 0.6; }

.slot-inner {
    width: 100%;
    flex: 1;
    background: #000;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.carousel-slot:not(.is-centre) .slot-inner {
    transition: all 0.3s ease;
}

.carousel-slot:not(.is-centre):hover .slot-inner {
    transform: scale(0.98);
}

/* Add overlay on top of video silhouette */
.carousel-slot:not(.is-centre) .slot-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(60, 60, 60, 0.5);
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.carousel-slot:not(.is-centre):hover .slot-inner::after {
    opacity: 1;
}

/* Hover text styling */
.hover-text {
    position: absolute;
    top: 15px;
    left: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.4s ease;
    transition-delay: 0.2s;
    z-index: 15;
    pointer-events: none;
}

.carousel-slot:not(.is-centre):hover .hover-text {
    opacity: 1;
}

/* Main video hover text styling */
.main-hover-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% + 80px));
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.4s ease;
    transition-delay: 0.2s;
    z-index: 15;
    pointer-events: none;
    text-align: center;
}

/* Show main hover text only when the specific slot is centered and hovered */
#slot0.is-centre:hover .main-hover-text,
#slot1.is-centre:hover .main-hover-text,
#slot2.is-centre:hover .main-hover-text,
#slot3.is-centre:hover .main-hover-text {
    opacity: 1;
}

/* Override existing positioning so these sit inside slot-inner */
.video-silhouette {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 10px;
    z-index: 1;
}

.play-button {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 2;
}