@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&family=Open+Sans:wght@400;600;700&display=swap');

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

body {
    font-family: 'Roboto', 'Open Sans', Arial, Helvetica, sans-serif;
    background: #f5f7fa;
    background-image: url("images/fondo.svg");
    background-size: contain;
    background-position: center;
    background-repeat: repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 600px;
}

.chat-header {
    background: linear-gradient(135deg, #0066CC 0%, #004499 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 10px 0;
}

.header-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.5);
    background: #ffffff;
    padding: 3px;
}

.header-text {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.chat-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.university-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    width: 100%;
}

.university-logo::before {
    content: "";
    display: inline-block;
    width: 80px;
    height: 80px;
    background-image: url("images/avatar.svg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    margin-right: 15px;
    vertical-align: middle;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.5);
    background-color: #ffffff;
    padding: 3px;
}

.university-logo h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.chat-header p {
    font-size: 14px;
    opacity: 0.9;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #ffffff;
    position: relative;
}

.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

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

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

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.bot-message .message-content {
    background: #E8F4F8;
    color: #003366;
    border-bottom-left-radius: 4px;
}

.user-message .message-content {
    background: #0066CC;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-input {
    padding: 12px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.question-container {
    margin-bottom: 0px;
}

.question {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.answers-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: capitalize;
}

.btn-primary {
    background: linear-gradient(135deg, #0066CC 0%, #004499 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 102, 204, 0.4);
    background: linear-gradient(135deg, #0052A3 0%, #003366 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #0066CC 0%, #004499 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #0052A3 0%, #003366 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 102, 204, 0.4);
}

.btn-answer {
    background: #ffffff;
    color: #003366;
    border: 2px solid #0066CC;
}

.btn-answer:hover {
    background: #0066CC;
    color: white;
    border-color: #004499;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 102, 204, 0.3);
}

.controls {
    text-align: center;
}

.controls .btn {
    margin: 0 10px;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #0066CC;
    border-radius: 3px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .chat-container {
        height: 500px;
    }
    
    .chat-header h1 {
        font-size: 20px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .answers-container {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-answer {
        width: 100%;
        max-width: 300px;
    }
}

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

.message {
    animation: fadeIn 0.3s ease;
}

.btn-answer {
    animation: fadeIn 0.3s ease;
}

/* Estados de carga */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0066CC;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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