@font-face {
    font-family: 'VCR OSD Mono';
    src: url('/static/font/VCR_OSD_MONO_1.001.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'VCR OSD Mono', monospace;
    margin: 0;
    padding: 20px;
    background-image: url('/static/img/bg.png');
    background-repeat: repeat;
    -webkit-text-size-adjust: 100%; /* Prevent automatic text size adjustment */
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: rgba(185, 161, 113, 0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    color: #333;
}

.controls-container {
    display: flex;
    margin-top: 20px;
    padding: 15px;
    background-color: #5E4B3E; /* Earthy brown */
    border-radius: 10px;
    font-family: 'VCR OSD Mono', monospace;
}

.topic-form {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.topic-form input {
    flex: 1;
    padding: 10px;
    background-color: #8C7B6B; /* Lighter earthy brown */
    color: #F5F1E6; /* Off-white */
    border: 2px solid #3D3128; /* Dark brown */
    border-radius: 5px;
    font-size: 16px; /* Keep 16px minimum font size to prevent zoom */
    font-family: 'VCR OSD Mono', monospace;
    touch-action: manipulation; /* Prevent double-tap zoom */
}

/* Improve placeholder text contrast */
.topic-form input::placeholder {
    color: #F5F1E6; /* Off-white with more opacity */
    opacity: 0.8;
    font-weight: bold;
}

.vcr-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.vcr-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: #8C7B6B; /* Lighter earthy brown */
    border: 2px solid #3D3128; /* Dark brown */
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.vcr-button:hover {
    background-color: #A89985; /* Even lighter brown on hover */
    transform: scale(1.05);
}

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

.vcr-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #8C7B6B; /* Default background without hover effect */
    transform: none; /* No hover transform */
}

.vcr-button.disabled:hover {
    background-color: #8C7B6B; /* Same as non-hover to prevent effect */
    transform: none;
}

.vcr-button.play {
    color: #FFFFFF; /* White for better contrast */
    background-color: #6B8E4E; /* Green */
}

.vcr-button.stop {
    color: #FFFFFF; /* White for better contrast */
    background-color: #9E5A55; /* Red */
}

.vcr-button.loading {
    color: #FFFFFF; /* White for better contrast */
    background-color: #8C7B6B; /* Neutral color for loading */
    cursor: wait;
}

.vcr-button.reset {
    color: #FFFFFF; /* White for better contrast */
    background-color: #5A7D8C;
}

.conversation-container {
    position: relative;
    margin-top: 20px;
    width: 100%;
    max-width: 1536px; /* Image natural width */
    margin-left: auto;
    margin-right: auto;
    overflow: hidden; /* Prevent overflow issues */
}

#chat-bubbles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allow clicks to pass through */
}

.conversation-image {
    width: 100%;
    border-radius: 10px;
    display: block;
}

.chat-bubble {
    position: absolute;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 280px;
    min-height: 60px; /* Minimum height for approximately 3 lines */
    word-wrap: break-word;
    opacity: 0;
    animation: fade-in 0.5s ease-in forwards;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Add subtle shadow for depth */
    user-select: none; /* Prevent text selection */
    transition: opacity 0.5s ease; /* Faster fade transition */
    font-size: 16px; /* Default font size */
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.marcus-bubble {
    background-color: #f0dec6;
    color: #000;
    left: 58.6%;
    top: 17%;
    transform: translate(-50%, -50%);
    z-index: 10; /* Ensure Marcus bubbles are on top */
}

.bonnie-bubble {
    background-color: #dfd2d9;
    color: #000;
    left: 28.6%;
    top: 15%;
    transform: translate(-50%, -50%);
    z-index: 10; /* Ensure Bonnie bubbles are on top */
}

.speech-arrow::after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
}

.marcus-bubble::after {
    border-top-color: #f0dec6;
    border-bottom: 0;
    left: 45%;
    bottom: -9px; /* Fixed: Move up 1px to eliminate gap */
}

.bonnie-bubble::after {
    border-top-color: #dfd2d9;
    border-bottom: 0;
    left: 58%;
    bottom: -9px; /* Fixed: Move up 1px to eliminate gap */
}

/* Spinning animation for loading */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-icon {
    animation: spin 1.5s linear infinite;
}

/* Mobile responsive styles */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    .controls-container {
        padding: 10px;
    }
    
    .topic-form {
        gap: 10px;
    }
    
    .topic-form input {
        font-size: 16px; /* Keep at 16px to prevent zoom on mobile */
        padding: 8px;
        -webkit-appearance: none; /* Remove iOS default styling */
        appearance: none;
    }
    
    /* Improve mobile placeholder contrast */
    .topic-form input::placeholder {
        opacity: 0.9;
    }
    
    .vcr-button {
        width: 40px;
        height: 40px;
    }
    
    .vcr-button svg {
        width: 20px;
        height: 20px;
    }
    
    /* Make chat bubbles responsive on mobile */
    .chat-bubble {
        max-width: 40%; /* Narrower on mobile */
        min-height: 40px; /* Smaller minimum height */
        padding: 8px 12px;
        font-size: 12px; /* Smaller font size */
        line-height: 1.2;
    }
    
    /* Adjust bubble positions to prevent overflow */
    .marcus-bubble {
        left: 56%; /* Move slightly more toward center */
        top: 16%;
    }
    
    .bonnie-bubble {
        left: 32%; /* Move slightly more toward center */
        top: 14%;
    }
    
    /* Smaller speech arrows */
    .speech-arrow::after {
        border-width: 8px;
    }
    
    /* Fix arrow positioning for mobile */
    .marcus-bubble::after {
        bottom: -7px; /* Adjust for smaller border-width on mobile */
    }
    
    .bonnie-bubble::after {
        bottom: -7px; /* Adjust for smaller border-width on mobile */
    }
}

/* Extra small devices */
@media screen and (max-width: 480px) {
    .chat-bubble {
        max-width: 38%; /* Even narrower on very small screens */
        min-height: 30px;
        padding: 6px 10px;
        font-size: 10px; /* Even smaller font size */
    }
    
    /* Further adjust positions */
    .marcus-bubble {
        left: 54%;
    }
    
    .bonnie-bubble {
        left: 34%;
    }
    
    /* Adjust the controls for very small screens */
    .vcr-buttons {
        gap: 8px;
    }
    
    .vcr-button {
        width: 36px;
        height: 36px;
    }
} 