/* Main CSS styles for the chat interface */

body { 
    font-family: Arial, sans-serif; 
    max-width: 100%; 
    margin: 0 auto; 
    padding: 10px; 
    background-color: #f5f5f5;
}

/* Debug window styles */
.debug-window {
    width: 100%;
    padding: 8px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
}

.debug-textarea {
    width: 100%;
    height: 100px;
    font-family: monospace;
    padding: 5px;
    border: 1px solid #ccc;
    margin-bottom: 10px;
    border-radius: 3px;
    white-space: pre;
    font-size: 12px;
}

.chat-container {
    width: 100%;
    height: 85vh;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 12px;
    background-color: #5c4ee5;
    color: white;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (min-width: 768px) {
    .chat-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    body {
        padding: 20px;
        max-width: 800px;
    }
}

.chat-header h1 {
    margin: 0;
    font-size: 1.2rem;
}

.header-buttons {
    display: flex;
    gap: 8px;
}

#chat { 
    flex-grow: 1;
    height: calc(100% - 130px);
    overflow-y: auto; 
    padding: 12px;
}

.message-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
    max-width: 90%;
    position: relative;
}

.message-container.user {
    align-items: flex-start !important;
    margin-left: 0 !important;
    margin-right: auto !important;
}

.message-container.assistant {
    align-items: flex-start;
    margin-right: auto;
}

.message-label {
    font-size: 12px;
    margin-bottom: 4px;
    font-weight: bold;
    color: #666;
}

.message {
    padding: 12px;
    border-radius: 10px;
    white-space: pre-wrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: relative;
    font-size: 15px;
    line-height: 1.4;
}

.user-message {
    background-color: #e2f4ff;
    color: #333;
    border-top-right-radius: 4px;
    text-align: left !important;
    border: 1px solid #cce4f5;
}

.assistant-message {
    background-color: #f0f0f0;
    color: #333;
    border-top-left-radius: 4px;
    border: 1px solid #e0e0e0;
}

.input-area { 
    padding: 12px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
}

.message-input-container {
    position: relative;
    flex-grow: 1;
}

#message { 
    width: 100%;
    padding: 16px !important;
    border: 1px solid #ddd;
    border-radius: 20px;
    min-height: 80px !important;
    resize: none;
    box-sizing: border-box;
    font-size: 18px !important;
    line-height: 1.4 !important;
}

button { 
    padding: 12px 16px; 
    background-color: #5c4ee5; 
    color: white; 
    border: none; 
    border-radius: 20px;
    cursor: pointer;
    height: auto;
    align-self: center;
    font-size: 15px;
    font-weight: bold;
    min-width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    background-color: #4a3dd1;
}

button:active {
    transform: scale(0.98);
}

/* Disable send button when processing */
button:disabled {
    background-color: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

button:disabled:hover {
    background-color: #ccc !important;
    transform: none !important;
}

.loading-indicator {
    padding: 10px;
    font-style: italic;
    color: #888;
    display: flex;
    align-items: center;
}

.loading-indicator::after {
    content: "●●●";
    animation: loading 1.5s infinite;
    margin-left: 5px;
    letter-spacing: 2px;
}

@keyframes loading {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

/* Download chat option */
.download-btn {
    margin-right: 5px;
    background-color: #4CAF50;
}

.download-btn:hover {
    background-color: #45a049;
}

/* Completion message container */
.completion-container {
    display: none;
    text-align: center;
    padding: 30px 15px;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.completion-container h2 {
    color: #5c4ee5;
    margin-bottom: 20px;
    font-size: 24px;
}

.completion-container p {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    max-width: 600px;
}

.check-icon {
    font-size: 50px;
    color: #4CAF50;
    margin-bottom: 20px;
}

/* Record exists message */
.record-exists-container {
    display: none;
    text-align: center;
    padding: 30px 15px;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.record-exists-container h2 {
    color: #ff6b6b;
    margin-bottom: 20px;
    font-size: 22px;
}

.record-exists-container p {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    max-width: 600px;
}

.info-icon {
    font-size: 50px;
    color: #ff6b6b;
    margin-bottom: 20px;
}

/* Send button with SVG icon */
.send-icon {
    width: 18px;
    height: 18px;
}

/* Disable input when processing */
#message:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Add visual indicator when chat is disabled */
.input-area.disabled {
    opacity: 0.7;
    pointer-events: none;
}

/* Hide microphone button on mobile devices */
@media (max-width: 768px) {
    #mic-button {
        display: none !important;
    }
    
    #recording-status {
        display: none !important;
    }
    
    /* Adjust message input padding when mic is hidden */
    #message {
        padding-right: 16px !important;
    }
    
    /* Make sure message input takes full width when mic is hidden on mobile */
    .message-input-container {
        width: 100%;
    }
    
    #message {
        width: 100%;
        box-sizing: border-box;
    }
}