/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Nunito', sans-serif;
    background: #222; /* Dark background outside the 9:16 area */
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100dvh;
    max-width: calc(100dvh * 9 / 16);
    background: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

/* Header */
.app-header {
    background-color: #000;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.header-titles {
    flex: 1;
    text-align: center;
}

.header-titles h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.header-titles h2 {
    margin: 2px 0 0 0;
    font-size: 14px;
    font-weight: 400;
    color: #eee;
}

.header-settings {
    position: absolute;
    right: 15px;
    top: 15px;
    cursor: pointer;
    background: transparent;
    padding: 2px;
}
.header-settings svg {
    display: block;
}

/* Scene Area (Background & Character) */
.scene-area {
    flex: 1;
    position: relative;
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    overflow: hidden;
}

/* Speech Bubble */
.speech-container {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.3s;
}

.speech-bubble {
    background: #fff;
    border-radius: 20px;
    padding: 25px 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    text-align: center;
    font-size: 16px;
    color: #222;
    line-height: 1.4;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.speech-tail {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 20px solid #fff;
    margin-top: -1px; /* overlap to hide gap */
    filter: drop-shadow(0 4px 3px rgba(0,0,0,0.05));
}

/* Character */
#character-img {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    height: 60%;
    max-height: 400px;
    object-fit: contain;
    z-index: 10;
    pointer-events: none;
}

/* Footer (Input Area) */
.app-footer {
    background-color: #000;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 20;
}

.voice-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #2a7c78; /* Teal color from reference */
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: 0.3s;
}

.voice-btn.active {
    background-color: #2a7c78;
}

.voice-btn.inactive {
    background-color: #555;
    opacity: 0.7;
}

.voice-btn img {
    width: 20px;
    height: auto;
    filter: brightness(0) invert(1); /* Make it white if it's black */
}

.input-wrapper {
    flex: 1;
    background: #fff;
    height: 45px;
    border-radius: 2px;
}

#user-input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    padding: 0 15px;
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
    background: transparent;
}

.send-btn {
    background: transparent;
    border: none;
    padding: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn img {
    width: 35px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.3));
}

/* Loading Dots */
.typing { display: flex; gap: 4px; justify-content: center; }
.dot { width: 8px; height: 8px; background: #888; border-radius: 50%; animation: blink 1.4s infinite both; }
.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

/* Modal Styles */
.modal-overlay {
    display: none; /* Hidden by default */
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 100;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #fff;
    width: 80%;
    max-width: 300px;
    border-radius: 15px;
    padding: 25px 20px 20px 20px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    transform: translateY(-20px);
    transition: transform 0.3s;
    position: relative;
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.close-x-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    transition: 0.2s;
}

.close-x-btn:hover {
    color: #ff4757;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.modal-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.action-btn {
    background: #e2c29c; /* Coklat krem */
    color: #4a3623; /* Darker brown for contrast */
}
.action-btn:hover {
    background: #d6b68a;
}
