/* style.css content here */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #1a2a6c);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

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

header {
    background: #2c3e50;
    color: white;
    padding: 20px;
    text-align: center;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

header p {
    opacity: 0.8;
    font-size: 1rem;
}

main {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px;
    background: #f8f9fa;
}

#chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    padding: 15px;
    border-radius: 10px;
    max-width: 80%;
    animation: fadeIn 0.3s ease-in;
}

.message.user {
    background: #3498db;
    color: white;
    align-self: flex-end;
}

.message.assistant {
    background: #e9ecef;
    align-self: flex-start;
}

.role {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.content {
    word-wrap: break-word;
}

#input-form {
    display: flex;
    gap: 10px;
}

#user-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#user-input:focus {
    outline: none;
    border-color: #3498db;
}

#submit-btn {
    padding: 15px 25px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background 0.3s;
}

#submit-btn:hover:not(:disabled) {
    background: #1a252f;
}

#submit-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

#loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #e9ecef;
    border-radius: 10px;
    align-self: flex-start;
}

.hidden {
    display: none !important;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid #2c3e50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

footer {
    background: #2c3e50;
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 0.9rem;
}

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

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

/* Mobile responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        height: 95vh;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    main {
        padding: 15px;
    }
    
    #chat-container {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .message {
        max-width: 90%;
        padding: 12px;
    }
    
    #input-form {
        flex-direction: column;
    }
    
    #submit-btn {
        padding: 12px;
    }
}