/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'DR-Bold';
    src: url('assets/fonts/dr-bold-TRIAL.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'DR-Light';
    src: url('assets/fonts/dr-light-TRIAL.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'DR-Light', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
}

/* Prevent scrolling on index and message pages */
body.index-page,
body.message-page {
    overflow: hidden;
    height: 100vh;
}

body.index-page .container,
body.message-page .container {
    height: 100vh;
    overflow: hidden;
}

body.index-page .main,
body.message-page .main {
    height: 100vh;
    overflow: hidden;
}

/* Index page - lower opacity for lighter background */
body.index-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/images/morgan-desktop-webp.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.3;
    z-index: -1;
}

/* Message page - higher opacity for darker background */
body.message-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/images/morgan-desktop-webp.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.6;
    z-index: -1;
}

.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 500px;
    width: 100%;
}

.logo {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 10;
}

.logo-image {
    height: 20px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.content {
    text-align: center;
    width: 100%;
}

.title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.subtitle {
    font-size: 1.8rem;
    margin-bottom: 3rem;
    color: #ffffff;
    line-height: 1.6;
}

.form {
    margin-bottom: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.code-inputs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.code-input {
    width: 60px;
    height: 60px;
    padding: 0.5rem;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid #333;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: 600;
}

.code-input:focus {
    outline: none;
    border-color: #F1FE06;
    box-shadow: 0 0 20px rgba(241, 254, 6, 0.3);
}

.code-input::placeholder {
    color: #999;
    text-transform: uppercase;
    font-weight: 500;
}

.input {
    width: 100%;
    padding: 1rem;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid #333;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
    letter-spacing: 0.3rem;
    text-transform: uppercase;
}

.input:focus {
    outline: none;
    border-color: #F1FE06;
    box-shadow: 0 0 20px rgba(241, 254, 6, 0.3);
}

.input::placeholder {
    color: #666;
    letter-spacing: 0.3rem;
    text-transform: uppercase;
}

.button {
    width: 100%;
    padding: 1rem 2rem;
    font-family: 'DR-Bold', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    background: linear-gradient(45deg, #F1FE06, #E6F500);
    color: #1a1a1a;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(241, 254, 6, 0.3);
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.whatsapp-button {
    width: 100%;
    padding: 1rem 2rem;
    font-family: 'DR-Bold', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    background: linear-gradient(45deg, #F1FE06, #E6F500);
    color: #1a1a1a;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.whatsapp-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(241, 254, 6, 0.3);
}

.whatsapp-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.email-button {
    width: 100%;
    padding: 1rem 2rem;
    font-family: 'DR-Bold', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    background: #ffffff;
    color: #1a1a1a;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.email-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.3);
}

.email-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.cta-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
    justify-content: center;
    align-items: center;
}

.error {
    color: #ff6b6b;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
}

.message {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: #ffffff;
    text-align: left;
}

.video-container {
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.video {
    width: 100%;
    height: 300px;
    border: none;
}

/* Custom video player styles */
.custom-video-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.custom-video-player {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Mobile: fit within container, black bars on sides if needed */
    cursor: pointer;
}

.video-controls-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: background 0.3s ease;
}

.video-controls-overlay:hover {
    background: transparent;
}

.play-button-overlay {
    position: relative;
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: background 0.3s ease;
    cursor: pointer;
    margin-bottom: 2rem;
}

.play-button-overlay:hover {
    background: transparent;
}

.play-button {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.play-button-overlay:hover .play-button {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

/* Fullscreen Video Player */
.fullscreen-video-player {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    background: #000;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    isolation: isolate;
}

.custom-video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: none;
    opacity: 1;
}

.video-controls-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.close-video-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100000;
    pointer-events: auto;
}

.close-video-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}



/* Progress Bar */
.progress-bar-container {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    z-index: 100000;
    background: transparent;
}

.progress-bar {
    width: 80%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: height 0.2s ease;
}

.progress-bar:hover {
    height: 6px;
}

.progress-fill {
    height: 100%;
    background: #F1FE06;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
}

/* CTA Overlay */
.cta-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    pointer-events: none;
}

.cta-buttons-overlay {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.whatsapp-button-overlay,
.email-button-overlay {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.whatsapp-button-overlay {
    background: linear-gradient(45deg, #F1FE06, #E6F500);
    color: #1a1a1a;
}

.email-button-overlay {
    background: #ffffff;
    color: #1a1a1a;
}

.whatsapp-button-overlay:hover,
.email-button-overlay:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Video States */
.custom-video-container.playing .play-button-overlay {
    display: none;
}

.custom-video-container.playing .video-controls {
    display: block;
}

.custom-video-container.playing .cta-overlay {
    display: flex;
}

.help {
    margin-top: 2rem;
}

.help-link {
    color: #F1FE06;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
}

.help-link:hover {
    text-decoration: underline;
}

.help-text {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #888;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.help-text.show {
    opacity: 1;
}

/* Fullscreen help overlay (click anywhere or auto fade-out after 3s) */
.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.4s ease;
}
.help-overlay.help-overlay-fade-out {
    opacity: 0;
}

.help-overlay-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-close-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
}

.help-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.help-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.help-image-text {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    font-family: 'DR-Bold', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 1001;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-size: 1.2rem;
    color: #F1FE06;
}

/* CTA Overlay in Fullscreen */
.cta-overlay-fullscreen {
    position: absolute;
    bottom: 85px;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    pointer-events: none;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    /* Index page mobile - lower opacity */
    body.index-page::before {
        background-image: url('assets/images/morgan-mobile-webp.webp');
        opacity: 0.3;
    }
    
    /* Message page mobile - higher opacity */
    body.message-page::before {
        background-image: url('assets/images/morgan-mobile-webp.webp');
        opacity: 0.6;
    }
    
    .container {
        padding: 0.5rem;
    }
    
    /* Mobile-specific no-scroll adjustments */
    body.index-page .container,
    body.message-page .container {
        padding: 0.5rem;
    }
    
    body.index-page .main,
    body.message-page .main {
        padding: 0.5rem 0;
    }
    
    .logo {
        top: 1rem;
        left: 1rem;
    }
    
    .logo-image {
        height: 17px;
        max-width: 90vw;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1.5rem;
    }
    
    .code-inputs {
        gap: 0.3rem;
    }
    
    .code-input {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .input {
        font-size: 1.2rem;
        padding: 0.8rem;
    }
    
    .button {
        padding: 0.8rem 1.5rem;
        font-size: 1.1rem;
    }
    
    /* Mobile help overlay adjustments */
    .help-close-btn {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .help-image-text {
        bottom: 1rem;
        left: 1rem;
        font-size: 1rem;
    }
    
    /* Mobile video player adjustments */
    .play-button {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .close-video-btn {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
    
    .close-video-btn {
        top: 1rem;
        right: 1rem;
    }
    

    
    /* Mobile progress bar adjustments */
    .progress-bar-container {
        height: 50px;
    }
    

    
    .cta-overlay-fullscreen {
        bottom: 65px;
    }
    
    .whatsapp-button-overlay,
    .email-button-overlay {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Android-specific video player fixes */
    .fullscreen-video-player {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        overflow: hidden !important;
        transform: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        outline: none !important;
        align-items: flex-start !important;
        justify-content: center !important;
    }
    
    /* Ensure video fits within viewport without cropping */
    .custom-video-player {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        min-height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        outline: none !important;
    }
    
    /* Force controls to be visible and properly positioned */
    .close-video-btn {
        top: 1rem !important;
        right: 1rem !important;
        position: absolute !important;
        /* Don't force display - let JavaScript control visibility */
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 100000 !important;
    }
    

    
    .progress-bar-container {
        bottom: 30px !important;
        position: absolute !important;
        /* Don't force display - let JavaScript control visibility */
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 100000 !important;
        height: 60px !important;
        background: transparent !important;
    }
    
    .cta-overlay-fullscreen {
        bottom: 75px !important;
        position: absolute !important;
        /* Don't force display - let JavaScript control visibility */
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 100000 !important;
    }
    
    /* Override any inherited styles that might hide controls */
    .video-controls-overlay {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        pointer-events: none !important;
        background: transparent !important;
    }
    
    /* Ensure video controls overlay doesn't interfere */
    .video-controls-overlay * {
        pointer-events: auto !important;
    }
}

/* Video Player Override Rules */
.fullscreen-video-player,
.fullscreen-video-player * {
    opacity: 1 !important;
    filter: none !important;
}

.fullscreen-video-player::before,
.fullscreen-video-player::after {
    display: none !important;
}

/* Ensure video element is completely clean */
#customVideo {
    opacity: 1 !important;
    filter: none !important;
    background: #000 !important;
    position: relative !important;
    z-index: 10001 !important;
    mix-blend-mode: normal !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Ensure controls remain visible */
.close-video-btn,
.progress-bar-container,
.cta-overlay-fullscreen {
    opacity: 1 !important;
    visibility: visible !important;
    /* Don't force display - let JavaScript control visibility */
}

/* Force remove any inherited background effects */
.fullscreen-video-player {
    background: #000 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    isolation: isolate !important;
    contain: layout style paint !important;
    mix-blend-mode: normal !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* CSS Custom Properties for mobile viewport */
:root {
    --vh: 1vh;
}

/* Force mobile video player to cover entire screen */
@media (max-width: 768px) {
    /* Only apply overflow hidden when video player is active */
    body.video-player-active, html.video-player-active {
        overflow: hidden !important;
        height: 100vh !important;
        height: calc(var(--vh, 1vh) * 100) !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .fullscreen-video-player {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: calc(var(--vh, 1vh) * 100) !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        overflow: hidden !important;
        transform: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        outline: none !important;
        z-index: 9999 !important;
        align-items: flex-start !important;
        justify-content: center !important;
        /* Don't force display - let JavaScript control visibility */
    }
    
    /* Ensure video element itself has no gaps */
    .fullscreen-video-player .custom-video-player {
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        outline: none !important;
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
    }
}

/* Additional Android-specific fixes to eliminate any gaps */
@media (max-width: 768px) {
    .fullscreen-video-player {
        /* Don't force display - let JavaScript control visibility */
        align-items: flex-start !important;
        justify-content: center !important;
    }
    
    .fullscreen-video-player .custom-video-player {
        flex-shrink: 0 !important;
        flex-grow: 1 !important;
        align-self: flex-start !important;
    }
}


