html, body {
    margin: 0;
    overflow: hidden;
    background: black;
    width: 100%;
    height: 100%;
}

#video {
    display: none;
}

#canvas-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#canvas, #three-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: block;
}

#three-canvas {
    pointer-events: none;
}

/* --- Static Camera Overlay Logo (Top of screen) --- */
#camera-logo {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 32%;
    max-width: 160px;
    height: auto;
    z-index: 50;
    pointer-events: none; 
}

/* --- Dual Vertical Slider Panel (Right Side) --- */
#sliders-panel {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: row;                   /* Align sliders side-by-side */
    gap: 15px;
    z-index: 100;
}

/* Flex wrapper around each slider and its text label */
.slider-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;             /* Aligns label directly to bottom */
    height: 220px;
    width: 45px;
    position: relative;
}

.slider-group input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: rgba(220, 235, 233, 0.6);  
    border: 2px solid #78b5af;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    width: 160px;                          /* Slider length */
    position: absolute;
    top: 75px;                             /* Pivot coordinates of rotation */
    transform: rotate(-90deg);
}

/* Slider Labels sitting underneath the vertical rails */
.slider-label {
    color: white;
    font-family: sans-serif;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    margin-top: auto;                      /* Pushes text directly under the slider */
    pointer-events: none;
    z-index: 10;
}

/* Slider Round Thumbs */
.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #dcebe9;
    border: 2.5px solid #2b2d2f;
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
    cursor: pointer;
    transition: background 0.15s;
}

.slider-group input[type="range"]::-webkit-slider-thumb:active {
    background: #78b5af;                   
}

.slider-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #dcebe9;
    border: 2.5px solid #2b2d2f;
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
    cursor: pointer;
}

/* --- Bottom Control Panel --- */
#control-panel {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 520px;
    height: 165px;                         
    background: rgba(220, 235, 233, 0.45); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 5px solid #78b5af;
    border-bottom: none;
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    display: flex;
    flex-direction: column;                
    justify-content: flex-start;
    align-items: center;
    z-index: 100;
    box-sizing: border-box;
    padding: 10px 10px 12px 10px;
}

#buttons-row {
    display: flex;
    width: 100%;
    justify-content: space-evenly;
    align-items: center;
}

#panel-logo {
    width: 25%;
    max-width: 120px;
    height: auto;
    margin-top: 10px;
}

/* --- Round Switcher Buttons --- */
.bg-btn {
    width: 76px;
    height: 76px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 3px solid #2b2d2f;             
    background-size: cover;
    background-position: center;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s;
}

.bg-btn:active {
    transform: scale(0.92);
}

.bg-btn.active {
    border-color: #78b5af;
    box-shadow: 0 0 12px #78b5af;
}

#btn-greece { background-image: url('assets/greece.png'); }
#btn-rome { background-image: url('assets/rome.png'); }
#btn-paris { background-image: url('assets/paris.png'); }
#btn-cairo { background-image: url('assets/cairo.png'); }

.btn-label {
    position: absolute;
    width: 100%;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-family: 'Arial Black', 'Impact', sans-serif;
    font-weight: 900;
    font-size: 15px;
    text-align: center;
    text-shadow: 
        -1.5px -1.5px 0 #000,  
         1.5px -1.5px 0 #000,
        -1.5px  1.5px 0 #000,
         1.5px  1.5px 0 #000,
         2px 2px 4px rgba(0,0,0,0.8);
    pointer-events: none;
}

#capture-btn {
    width: 86px;
    height: 86px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 3px solid #2b2d2f;
    background: #dcebe9;                   
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s, background-color 0.15s;
    padding: 0;
}

#capture-btn:active {
    transform: scale(0.92);
    background-color: #c7dbd9;
}

.capture-icon {
    width: 75%;
    height: 75%;
}

/* --- Outro Overlay Screen --- */
#outro-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('assets/outro.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: none;                         
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 35px 24px 35px 24px;          
}

#outro-logo {
    width: 32%;
    max-width: 150px;
    height: auto;
    margin-bottom: 15px;
    z-index: 210;
}

#preview-container {
    width: 100%;
    max-width: 440px;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;               
}

#outro-preview-img {
    max-width: 100%;
    max-height: 55vh;                      
    object-fit: contain;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 4px solid #78b5af;
}

#outro-bottom-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    z-index: 210;
    height: 300px;
}

/* Transparent Share Button */
#outro-share-btn {
    width: 68px;                           
    height: 68px;
    background: none;                      
    border: none;                          
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    outline: none;
    box-shadow: none;                      
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s;
    padding: 0;
    z-index: 210;
}

#outro-share-btn:active {
    transform: scale(0.90);
}

#share-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#outro-footer-text {
    margin-bottom: 0;
    color: #2b2d2f;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    min-height: 18px; 
    width: 90%;
    max-width: 400px;
}

#close-outro-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 42px;
    font-weight: bold;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    text-shadow: 0 2px 5px rgba(0,0,0,0.6);
    z-index: 220;
    -webkit-tap-highlight-color: transparent;
}

#status {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    background: rgba(0,0,0,.6);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: sans-serif;
    z-index: 10;
}

/* --- Responsive Adjustments --- */
@media (max-width: 430px) {
    #control-panel {
        height: 140px;                     
        padding: 8px 5px 10px 5px;
    }

    .bg-btn {
        width: 60px;                      
        height: 60px;
        border-width: 2px;                
    }

    #capture-btn {
        width: 72px;                      
        height: 72px;
        border-width: 2px;
    }

    #panel-logo {
        width: 28%;
        max-width: 95px;
        margin-top: 8px;
    }

    #camera-logo {
        top: 20px;
        max-width: 120px;
    }

    #sliders-panel {
        right: 8px;                        /* Move closer to the edge on portrait screens */
        gap: 6px;
    }

    .slider-group {
        height: 180px;                     /* Shorten slider rails for portrait aspect ratio */
        width: 35px;
    }

    .slider-group input[type="range"] {
        width: 120px;                      
        top: 55px;                         /* Recalibrate vertical rotation center */
    }

    .slider-label {
        font-size: 9px;
    }

    .btn-label {
        font-size: 11px;                  
        text-shadow: 
            -1px -1px 0 #000,  
             1px -1px 0 #000,
            -1px  1px 0 #000,
             1px  1px 0 #000,
             1px 1px 3px rgba(0,0,0,0.8);
    }
}

@media (max-width: 350px) {
    #control-panel {
        height: 115px;
        padding: 6px 4px 8px 4px;
    }

    .bg-btn {
        width: 48px;
        height: 48px;
    }

    #capture-btn {
        width: 58px;
        height: 58px;
    }

    #panel-logo {
        max-width: 75px;
        margin-top: 6px;
    }

    #camera-logo {
        top: 15px;
        max-width: 100px;
    }

    .btn-label {
        font-size: 9px;
    }
}