/* Global Styles */
* {
    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;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

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

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Messages */
.message {
    display: flex;
    margin-bottom: 10px;
    animation: fadeIn 0.3s ease-in;
}

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

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

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

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

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

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

.message-content p {
    margin: 0;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-source {
    display: block;
    font-size: 0.75rem;
    margin-top: 8px;
    opacity: 0.7;
    font-weight: 500;
}

.calculator-message .message-content {
    background: linear-gradient(135deg, #0b1739 0%, #1a2f65 100%);
    color: #f5f7ff;
    border: none;
    box-shadow: 0 12px 30px rgba(10, 15, 40, 0.3);
}

.calculator-message .message-source {
    color: rgba(255, 255, 255, 0.9);
}

.calculator-card p {
    margin-bottom: 8px;
}

.calculator-progress {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.calculator-progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transition: transform 0.2s ease;
}

.calculator-progress-dot.active {
    background: #ffd166;
    transform: scale(1.1);
}

.calculator-progress-dot.completed {
    background: #4ade80;
}

.calculator-progress-label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.calculator-summary {
    border-left: 4px solid #4ade80;
    padding-left: 14px;
}

.clarification-options {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.clarification-option {
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    padding: 10px 14px;
    background: #fdfdfd;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
}

.clarification-option:hover:not(:disabled) {
    background: #f1f5ff;
    border-color: #8fa0ff;
    color: #2c2c54;
}

.clarification-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Input Container */
.chat-input-container {
    display: flex;
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    gap: 10px;
}

#user-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

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

#user-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

#send-button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#send-button:active:not(:disabled) {
    transform: translateY(0);
}

#send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading Indicator */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: #667eea;
    font-weight: 500;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .message-content {
        max-width: 85%;
    }
}

