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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
}

.header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.status-badge.active {
    background: #4CAF50;
}

.status-badge.qualified {
    background: #2196F3;
}

.status-badge.rejected {
    background: #F44336;
}

.status-badge.expired {
    background: #9E9E9E;
}

.config-panel {
    padding: 20px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 200px;
}

.input-group label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.input-group input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

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

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #e5ddd5;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 35px, rgba(0,0,0,.03) 35px, rgba(0,0,0,.03) 70px);
}

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

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

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

.message.assistant {
    display: flex;
    justify-content: flex-start;
}

.message.system {
    display: flex;
    justify-content: center;
}

.message-content {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 8px;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.user .message-content {
    background: #DCF8C6;
    border-bottom-right-radius: 2px;
}

.message.assistant .message-content {
    background: white;
    border-bottom-left-radius: 2px;
}

.message.system .message-content {
    background: rgba(255, 255, 255, 0.8);
    padding: 8px 12px;
    font-size: 12px;
    color: #666;
    border-radius: 12px;
}

.message-time {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

.chat-input-container {
    padding: 15px 20px;
    background: #f0f0f0;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#messageInput {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
}

#messageInput:focus {
    outline: none;
    border-color: #25D366;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #25D366;
    color: white;
}

.btn-primary:hover {
    background: #20BA5A;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #667eea;
    color: white;
}

.btn-secondary:hover {
    background: #5568d3;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.info-panel {
    padding: 20px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
}

.info-panel h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-item label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.info-item span {
    font-size: 14px;
    color: #333;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #c62828;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        height: 100vh;
        border-radius: 0;
    }

    .header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .config-panel {
        flex-direction: column;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

.demo-banner {
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 14px;
}

.demo-banner[hidden] {
    display: none;
}
