@import url('./PSone.min.css');

/* Override body styles to integrate PSone theme with your 3D scene */
body {
    margin: 0;
    padding: 0;
    background: black;
    overflow: hidden;
    font-family: "Final Fantasy Script Collection - Final Fantasy VII", Arial, sans-serif;
    font-size: 16px;
    color: white;
    font-smooth: never;
    -webkit-font-smoothing: none;
}

#container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#threejs-canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    z-index: 100;
}

#chat-interface {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 200px;
}

/* Apply PSone button styling to record button */
#record-btn {
    /* Remove previous styles and let PSone .btn class handle it */
}

/* Apply PSone container styling to model selector */
#model-select {
    background: rgba(13, 34, 137, 0.9);
    border: 1px solid #c6c6c6;
    border-radius: 8px;
    color: white;
    padding: 8px 12px;
    font-family: "Final Fantasy Script Collection - Final Fantasy VII", Arial, sans-serif;
    font-size: 28px;
    cursor: pointer;
    outline: none;
    position: relative;
    z-index: 20;
    min-width: 150px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 30px;
}

#model-select:hover {
    background: rgba(13, 34, 137, 1);
    border-color: #fff;
}

#model-select:focus {
    border-color: #00ffff;
    box-shadow: 0 0 5px #00ffff;
}

#model-select option {
    background: rgba(13, 34, 137, 1);
    color: white;
    padding: 8px;
    font-family: "Final Fantasy Script Collection - Final Fantasy VII", Arial, sans-serif;
    font-size: 18px;
}

#megaman-response {
    display: none;
    color: #00ffff;
    font-size: 16px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid #00ffff;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 5px #00ffff; }
    to { box-shadow: 0 0 20px #00ffff; }
}

/* Apply PSone styling to controls info */
#controls-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: white;
    font-size: 28px;
    font-family: "Final Fantasy Script Collection - Final Fantasy VII", Arial, sans-serif;
    background-image: linear-gradient(#0D2289, #06093B);
    border: 1px solid #c6c6c6;
    border-radius: 8px;
    box-shadow: inset 0 0 2px 2px rgba(0,0,0,0.3);
    padding: 10px;
    backdrop-filter: blur(10px);
    z-index: 10;
}

/* Add the PSone container border effect */
#controls-info:before {
    position: absolute;
    display: block;
    content: '';
    border: 2px solid #fff;
    border-radius: 7px;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    z-index: 0;
    top: 0;
    left: 0;
}

#controls-info p {
    margin: 5px 0;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px #000;
    font-size: 28px;
} 

/* =================================================================
   RESPONSIVE DESIGN - Aggressive mobile bottom spacing
   ================================================================= */

/* Force minimum bottom spacing on ALL mobile devices */
@media screen and (max-width: 768px) {
    #controls-info {
        bottom: 100px !important; /* Force high bottom spacing */
        left: 10px;
        right: 10px;
    }
    #progress-container {
        display: none;
    }
}

/* Extra aggressive spacing for phones */
@media screen and (max-width: 480px) {
    #controls-info {
        bottom: 100px !important; /* Even higher for phones */
        left: 10px;
        right: 10px;
        max-height: calc(100vh - 120px); /* Prevent overflow */
        overflow: hidden;
    }
    #progress-container {
        display: none;
    }
}

/* Very short phone screens */
@media screen and (max-height: 700px) {
    #controls-info {
        bottom: 120px !important; /* Force even higher */
    }
    #progress-container {
        display: none;
    }
}

/* Ultra short screens (iPhone SE, etc.) */
@media screen and (max-height: 600px) {
    #controls-info {
        bottom: 140px !important;
    }
    #progress-container {
        display: none;
    }
}

/* Landscape phones - different approach */
@media screen and (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
    #controls-info {
        bottom: 60px !important;
        left: 10px;
        right: auto;
        max-width: 250px;
        font-size: 16px;
    }
    
    #controls-info p {
        font-size: 16px;
        margin: 2px 0;
        line-height: 1.2;
    }
}

/* Safe area support for phones with notches */
@supports (padding: max(0px)) {
    @media screen and (max-width: 480px) {
        #controls-info {
            bottom: max(150px, calc(env(safe-area-inset-bottom) + 80px)) !important;
            padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        }
    }
}

/* CRT Overlay - on top of everything */
#crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    pointer-events: none;
    mix-blend-mode: screen;
} 

/* Auth bar - top-left, sign-in / signed-in user */
#auth-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 20;
    display: flex;
    align-items: center;
}

#signin-open-btn {
    cursor: pointer;
}

#user-info {
    display: none;
    align-items: center;
    gap: 10px;
    background-image: linear-gradient(#0D2289, #06093B);
    border: 1px solid #c6c6c6;
    border-radius: 8px;
    box-shadow: inset 0 0 2px 2px rgba(0,0,0,0.3);
    padding: 6px 10px;
}

#user-name {
    font-family: "Final Fantasy Script Collection - Final Fantasy VII", Arial, sans-serif;
    font-size: 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#signout-btn {
    cursor: pointer;
}

/* Auth modal */
.auth-hidden {
    display: none !important;
}

#auth-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
}

#auth-modal-box {
    position: relative;
    width: 320px;
    max-width: calc(100vw - 40px);
    background-image: linear-gradient(#0D2289, #06093B);
    border: 1px solid #c6c6c6;
    border-radius: 8px;
    box-shadow: inset 0 0 2px 2px rgba(0,0,0,0.3);
    padding: 30px 20px 18px;
}

/* White inner border, matching #controls-info (PSone look) */
#auth-modal-box:before {
    position: absolute;
    display: block;
    content: '';
    border: 2px solid #fff;
    border-radius: 7px;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
}

/* Lift content above the white border (which sits at z-index 0) */
#auth-tabs,
#auth-form,
#auth-message,
#auth-resend {
    position: relative;
    z-index: 1;
}

#auth-close {
    position: absolute;
    top: 4px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

#auth-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.auth-tab {
    flex: 1;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid #c6c6c6;
    border-radius: 6px;
    color: #b9c6ff;
    font-family: "Final Fantasy Script Collection - Final Fantasy VII", Arial, sans-serif;
    font-size: 18px;
    padding: 6px 4px;
    cursor: pointer;
}

.auth-tab.active {
    color: white;
    border-color: #00ffff;
    box-shadow: 0 0 5px #00ffff;
}

#auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#auth-form input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #c6c6c6;
    border-radius: 6px;
    color: white;
    font-family: "Final Fantasy Script Collection - Final Fantasy VII", Arial, sans-serif;
    font-size: 18px;
    padding: 10px;
    outline: none;
}

#auth-form input:focus {
    border-color: #00ffff;
    box-shadow: 0 0 5px #00ffff;
}

#auth-submit {
    margin-top: 4px;
    cursor: pointer;
}

#auth-message {
    margin: 12px 0 0;
    font-size: 16px;
    min-height: 18px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

/* Collapse the message line when there's nothing to show (no dead space). */
#auth-message:empty {
    margin: 0;
    min-height: 0;
}

#auth-message[data-kind="error"] {
    color: #ff8a8a;
}

#auth-message[data-kind="info"] {
    color: #8affc1;
}

.auth-link {
    margin-top: 10px;
    background: none;
    border: none;
    color: #b9c6ff;
    font-size: 15px;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

/* Progress container - always visible, positioned below chat interface */
#progress-container {
    position: absolute;
    top: 130px;
    right: 20px;
    z-index: 10;
    width: 200px;
    background-image: linear-gradient(#0D2289, #06093B);
}

#progress-text {
    color: white;
    font-family: "Final Fantasy Script Collection - Final Fantasy VII", Arial, sans-serif;
    font-size: 26px;
    margin: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

#progress-bar {
    margin: 8px;
}

/* When showing regular progress, use normal bar */
#progress-fill {
    transition: width 0.5s ease;
} 