* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    color: rgb(255, 255, 255);
    text-shadow: 0px 1px 1px #101f3e;
    padding: 20px;
    text-align: center;
}

header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

header p {
    font-size: 14px;
    opacity: 0.8;
}

.main-content {
    display: flex;
    padding: 20px;
    gap: 20px;
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
}

.video-container {
    flex: 1;
    position: relative;
    border-radius: 60px;
    overflow: hidden;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
}

.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-history {
    height: 300px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid #eeeeee5a;
    border-radius: 10px;
    margin-bottom: 15px;
    background-color: #f9f9f930;
}

.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.user-message {
    align-items: flex-end;
}

.ai-message {
    align-items: flex-start;
}

.message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    margin-top: 5px;
    line-height: 1.4;
    position: relative;
}

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

.ai-message .message-bubble {
    background-color: #f0f2f5;
    color: #333;
    border-bottom-left-radius: 5px;
}

.message-label {
    font-size: 12px;
    color: white;
    margin-bottom: 3px;
}

.input-area {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#text-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 16px;
    transition: border-color 0.3s;
}

#text-input:focus {
    border-color: #4b6cb7;
}

.voice-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

button {
    background-color: #4b6cb7;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 25px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    background-color: #3a5a9c;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#start-voice-btn {
    background-color: #48bb78;
}

#stop-voice-btn {
    background-color: #f56565;
    display: none;
}

#send-btn {
    flex: 1;
}

.status {
    text-align: center;
    padding: 10px;
    font-size: 14px;
    color: white;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(75, 108, 183, 0.3);
    border-radius: 50%;
    border-top-color: #4b6cb7;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.copy-success {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
}

.show {
    opacity: 1;
}

.copyright {
    text-align: center;
    margin-top: 1rem;
    color: #ffffff;
    font-size: 0.85em;
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 600px) {
    .message-bubble {
        max-width: 90%;
    }

    .input-area,
    .voice-controls {
        flex-direction: column;
    }

    button {
        width: 100%;
    }
}