body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#app-container {
    width: 100%;
    max-width: 700px;
    height: 90vh;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    text-align: left;
}

header h1 {
    margin: 0;
    font-size: 1.5em;
}

header p {
    margin: 4px 0 0;
    font-size: 0.9em;
    opacity: 0.9;
}

#chat-container {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 85%;
}

.chat-message.ai {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #f0f2f5;
}

.chat-bubble {
    padding: 12px 18px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.user .chat-bubble {
    background-color: #4A90E2;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.ai .chat-bubble {
    background-color: #e9e9eb;
    color: #333;
    border-bottom-left-radius: 4px;
}

.chat-message.loading .chat-bubble {
    color: #888;
    font-style: italic;
}

.chat-message.error .chat-bubble {
    background-color: #ffebee;
    color: #c62828;
}

.chat-bubble p {
    margin-top: 0;
    margin-bottom: 0.5em;
}

.chat-bubble p:last-child {
    margin-bottom: 0;
}

.chat-bubble ul, .chat-bubble ol {
    padding-left: 20px;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.chat-bubble li {
    margin-bottom: 0.25em;
}

footer {
    padding: 15px;
    border-top: 1px solid #ddd;
    background-color: #f9f9f9;
    flex-shrink: 0;
}

#chat-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-wrapper {
    flex-grow: 1;
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 0 5px 0 15px;
    background: #fff;
}

textarea#prompt-input {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    padding: 10px 0;
    font-size: 1em;
    max-height: 100px;
    background: transparent;
}

.upload-btn {
    cursor: pointer;
    font-size: 1.5em;
    padding: 0 5px;
    color: #555;
    background: none;
    border: none;
}

#send-btn, #generate-image-btn {
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

#send-btn {
    background-color: #4A90E2;
}
#send-btn:hover {
    background-color: #357ABD;
}
#send-btn svg {
    width: 22px;
    height: 22px;
    margin-left: 2px;
}

#generate-image-btn {
    background-color: #8E44AD;
}
#generate-image-btn:hover {
    background-color: #7D3C98;
}
#generate-image-btn svg {
    width: 24px;
    height: 24px;
}

#image-preview-container {
    padding: 10px 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
#image-preview-container.hidden {
    display: none;
}

.preview-image-wrapper {
    position: relative;
}

.preview-image {
    max-height: 80px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.remove-preview-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
}

.generated-image {
    max-width: 100%;
    border-radius: 12px;
    display: block;
}

#camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
#camera-modal.hidden {
    display: none;
}
#camera-modal .modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
#camera-view {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
#camera-canvas.hidden {
    display: none;
}
#camera-modal .modal-controls {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}
#capture-btn {
    background: none;
    border: none;
    width: 70px;
    height: 70px;
    padding: 0;
    cursor: pointer;
}
.capture-outer-ring {
    width: 70px;
    height: 70px;
    border: 5px solid white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s ease;
}
.capture-inner-ring {
    width: 50px;
    height: 50px;
    background-color: white;
    border-radius: 50%;
}
#capture-btn:active .capture-outer-ring {
    transform: scale(0.95);
}
#close-camera-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 2em;
    cursor: pointer;
    line-height: 35px;
}

#voice-call-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease;
}
#voice-call-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#voice-call-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #2c3e50, #34495e);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
#voice-call-modal.hidden {
    display: none;
}
.voice-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 80%;
    color: white;
    text-align: center;
}
#call-status {
    font-size: 1.2em;
    height: 2em;
    margin-top: 20px;
}
#voice-visualizer {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}
.avatar-call {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.2s ease, box-shadow 0.5s ease;
}
.avatar-call.listening {
    animation: pulse 1.5s infinite;
}
.avatar-call.speaking {
    transform: scale(1.05);
    box-shadow: 0 0 30px #4A90E2, 0 0 50px #4A90E2;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
#end-call-btn {
    background-color: #e74c3c;
    border: none;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: rotate(135deg);
    transition: background-color 0.2s;
}
#end-call-btn:hover {
    background-color: #c0392b;
}

/* --- Style untuk Notifikasi Kustom --- */
#custom-alert-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1002;
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

#custom-alert-modal.hidden {
    display: flex;
    opacity: 0;
    pointer-events: none;
}

.alert-content {
    background: #fff;
    color: #333;
    padding: 25px 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 320px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: scale(1);
    transition: transform 0.2s ease-in-out;
}

#custom-alert-modal.hidden .alert-content {
    transform: scale(0.9);
}

#alert-message {
    margin: 0 0 20px 0;
    font-size: 1.1em;
    line-height: 1.5;
}

#close-alert-btn {
    background-color: #4A90E2;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

#close-alert-btn:hover {
    background-color: #357ABD;
}

