/* Import Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: #0f172a;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100%;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: cyan;
}

.profile-pic {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

/* Chat Container */
.chat-container {
    width: 100%;
    max-width: 900px;
    height: 85vh; /* Lebih fleksibel */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-top: 80px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(15px);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* Chat Box */
#chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
    max-height: calc(100% - 80px); /* Menyesuaikan tinggi */
}

/* Chat Bubbles */
.message {
    max-width: 90%;
    padding: 14px 20px;
    margin: 8px;
    border-radius: 20px;
    font-size: 16px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease-in-out;
}

.user-message {
    background: cyan;
    color: black;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.ai-message {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.chat-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    min-height: 50px;
}

.chat-input input {
    flex: 1;
    padding: 14px; /* Tambah padding agar lebih tinggi */
    border: none;
    border-radius: 8px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    outline: none;
    transition: 0.3s;
    min-height: 45px; /* Pastikan tidak gepeng */
}

.chat-input input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-input input:focus {
    background: rgba(255, 255, 255, 0.3);
}

.send-btn,
.voice-btn {
    background: linear-gradient(135deg, #00d4ff, #0084ff);
    border: none;
    width: 50px; /* Pastikan bulat */
    height: 50px; /* Sama dengan width */
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    color: white;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover,
.voice-btn:hover {
    background: linear-gradient(135deg, #00b3e6, #0068cc);
    transform: scale(1.1);
}

.send-btn:hover {
    background: linear-gradient(135deg, #00b3e6, #0068cc);
    transform: scale(1.1);
}

/* Animasi hover */
@keyframes pulse {
    0% { box-shadow: 0px 0px 10px rgba(0, 212, 255, 0.5); }
    50% { box-shadow: 0px 0px 20px rgba(0, 212, 255, 0.8); }
    100% { box-shadow: 0px 0px 10px rgba(0, 212, 255, 0.5); }
}

.send-btn:hover {
    animation: pulse 1s infinite;
}

/* Animasi */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .chat-container {
        width: 95%;
        height: 88vh;
    }

    .chat-input {
        padding: 12px;
    }

    .chat-input input {
        padding: 12px;
        font-size: 16px;
    }

    .send-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* Chat Options */
.chat-options {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.option-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Tombol Kirim & Rekam */
.send-btn,
.record-btn {
    background: linear-gradient(135deg, #00d4ff, #0084ff);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    color: white;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 4px 10px rgba(0, 212, 255, 0.3);
}

/* Efek Hover */
.send-btn:hover,
.record-btn:hover {
    background: linear-gradient(135deg, #00b3e6, #0068cc);
    transform: scale(1.1);
    box-shadow: 0px 4px 15px rgba(0, 212, 255, 0.5);
}

/* Efek saat tombol direkam */
.record-btn.active {
    background: linear-gradient(135deg, #ff3b30, #ff6347);
    animation: pulse 1s infinite;
}

/* Animasi Hover & Rekaman */
@keyframes pulse {
    0% { box-shadow: 0px 0px 10px rgba(255, 59, 48, 0.5); }
    50% { box-shadow: 0px 0px 20px rgba(255, 59, 48, 0.8); }
    100% { box-shadow: 0px 0px 10px rgba(255, 59, 48, 0.5); }
}

/* Efek saat mengirim pesan */
.user-message {
    background-color: #007bff;
    color: white;
    align-self: flex-end;
    padding: 10px 15px;
    border-radius: 15px 15px 0 15px;
    max-width: 70%;
    animation: fadeIn 0.3s ease-in-out;
}

/* Efek saat menerima pesan dari AI */
.ai-message {
    background-color: #e5e5ea;
    color: black;
    align-self: flex-start;
    padding: 10px 15px;
    border-radius: 15px 15px 15px 0;
    max-width: 70%;
    animation: fadeIn 0.3s ease-in-out;
}

/* Efek loading saat mengirim pesan */
.loading-message {
    background-color: rgba(0, 0, 0, 0.1);
    font-style: italic;
    align-self: flex-end;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 70%;
    animation: blink 1s infinite;
}

/* Tombol Kirim & Voice jadi bulat */
button {
    width: 40px;
    height: 40px;
    border-radius: 52%; /* Membuat tombol bulat */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px; /* Ukuran ikon lebih besar */
    border: none;
    background: #007bff;
    color: white;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

/* Efek hover */
button:hover {
    background: #0056b3;
    transform: scale(1.1); /* Sedikit membesar saat hover */
}

/* Efek klik */
button:active {
    transform: scale(0.9);
}
/* Efek animasi */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blink {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}
