/* Base Reset & Layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f6f8;
    color: #333;
    padding-bottom: 70px; /* Space for sticky footer bar */
}

/* Sample Page Content */
.page-content {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.hero-section {
    text-align: center;
    padding: 30px 10px;
}

.card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-top: 20px;
}

/* --- Fixed Bottom Chat Widget --- */
.chat-widget {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: all 0.3s ease-in-out;
}

/* Initially hide header and chat box in compact footer mode */
.chat-widget .chat-header,
.chat-widget .chat-box {
    display: none;
}

/* Footer Input Bar Layout */
.chat-footer-bar {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    gap: 8px;
}

.chat-footer-bar input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 24px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-footer-bar input:focus {
    border-color: #2196f3;
}

#mic-btn, #send-btn {
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 600;
}

#mic-btn {
    background: #f0f0f0;
    color: #333;
}

#send-btn {
    background: #2196f3;
    color: #fff;
}

/* --- EXPANDED FULL-SCREEN MOBILE VIEW --- */
.chat-widget.expanded {
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-radius: 0;
}

.chat-widget.expanded .chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #1976d2;
    color: #fff;
    font-weight: bold;
    font-size: 1.1rem;
}

.chat-widget.expanded .close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}

.chat-widget.expanded .chat-box {
    display: block;
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f9f9f9;
}

.chat-widget.expanded .chat-footer-bar {
    border-top: 1px solid #ddd;
    background: #fff;
}

/* Message Styles */
.message {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.4;
    font-size: 0.95rem;
}

.ai-msg {
    background: #e3f2fd;
    color: #0d47a1;
    align-self: flex-start;
}

.user-msg {
    background: #e8f5e9;
    color: #1b5e20;
    margin-left: auto;
}

.error-msg {
    background: #ffebee;
    color: #c62828;
}

/* Microphone Pulsing */
#mic-btn.recording {
    background: #e53935;
    color: #fff;
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}