/* AWS MAP Intake Assistant - Fixed Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.chat-container {
    width: 90%;
    max-width: 800px;
    height: 90vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.doit-logo {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.chat-header-content {
    flex: 1;
}

.chat-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.chat-header .subtitle {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 4px;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    min-height: 0;
}

.message {
    display: flex;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-size: 15px;
    line-height: 1.5;
}

.message.bot .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.message.user .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
    max-width: 50%;
    padding: 10px 14px;
    width: fit-content;
}

.message-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 5px;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    padding: 12px 18px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.typing-indicator.active {
    display: block;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #667eea;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
}

.welcome-screen h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 15px;
}

.welcome-screen p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
    max-width: 500px;
}

.start-button {
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 10px;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.start-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Completion Screen */
.completion-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
}

.completion-screen h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 15px;
}

.completion-screen p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
    max-width: 500px;
}

.completion-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.restart-button {
    margin-top: 20px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.restart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Input Area */
.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

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

.char-counter {
    position: absolute;
    right: 15px;
    bottom: -18px;
    font-size: 11px;
    color: #999;
}

.char-counter.warning {
    color: #f59e0b;
}

.char-counter.error {
    color: #ef4444;
}

.chat-input {
    width: 100%;
    padding: 12px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
    resize: none;
    min-height: 50px;
    max-height: 120px;
    overflow-y: auto;
}

.chat-input:focus {
    border-color: #667eea;
}

.chat-input.error {
    border-color: #ef4444;
}

.send-button {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.send-button:hover {
    transform: scale(1.1);
}

.send-button:active {
    transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .welcome-screen, .completion-screen {
        padding: 30px 20px;
    }
}
