/* Importar tipografía Roboto */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap');

/* Variables CSS - Paleta Praxademy */
:root {
    /* Colores principales */
    --primary-color: #080055;
    --primary-dark: #0A51BF;
    --secondary-color: #0366FF;
    
    /* Colores de extensión */
    --accent-blue: #24A5F5;
    --accent-cyan: #30CCF8;
    --white: #FFFFFF;
    
    /* Backgrounds y superficies */
    --background: linear-gradient(135deg, #080055 0%, #0A51BF 100%);
    --surface: rgba(255, 255, 255, 0.95);
    --surface-glass: rgba(255, 255, 255, 0.1);
    
    /* Textos */
    --text-primary: #FFFFFF;
    --text-secondary: #FFFFFF;
    --text-dark: #080055;
    
    /* Bordes y sombras */
    --border-color: rgba(255, 255, 255, 0.2);
    --error-color: #EA4335;
    --shadow: 0 4px 20px rgba(8, 0, 85, 0.3);
    --shadow-glass: 0 8px 32px rgba(8, 0, 85, 0.2);
}

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

body {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.header {
    background: linear-gradient(135deg, #080055 0%, #0A51BF 100%);
    color: #FFFFFF;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(8, 0, 85, 0.3);
    position: relative;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #FFFFFF;
}

.subtitle {
    font-size: 0.875rem;
    color: #FFFFFF;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #FFFFFF;
}

.user-info span {
    color: #FFFFFF;
    font-size: 0.875rem;
}

.config-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 24px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.config-btn:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow);
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    background: #ffffff;
    margin: 1rem 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

/* Messages */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    animation: slideIn 0.3s ease-out;
}

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

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

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

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

.user-message .message-content {
    background: #0366FF;
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
}

.assistant-message .message-content {
    background: #ffffff;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message-content p {
    margin-bottom: 0.5rem;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Loading Animation */
.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 1rem 1.25rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}

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

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

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

/* Input Area */
.input-area {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--surface);
}

.input-container {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

#userInput {
    flex: 1;
    border: 2px solid rgba(6, 102, 255, 0.2);
    border-radius: 24px;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    max-height: 150px;
    transition: border-color 0.2s;
    background: #ffffff;
}

#userInput:focus {
    outline: none;
    border-color: #0366FF;
    box-shadow: 0 0 0 3px rgba(6, 102, 255, 0.1);
}

#sendBtn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

#sendBtn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

#sendBtn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

/* Estilos para estados del contador de consultas */
.normal {
    color: #0366FF;
    font-weight: 500;
}

.limit-warning {
    color: #ff9800;
    font-weight: 500;
}

.limit-reached {
    color: #f44336;
    font-weight: 600;
}

.info-text {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #666;
    text-align: center;
}

/* Estilos específicos para el contador de consultas */
#conversationInfo {
    color: #0366FF !important;
    font-weight: 500 !important;
}

#conversationInfo .normal {
    color: #0366FF !important;
    font-weight: 500 !important;
}

#conversationInfo .limit-warning {
    color: #ff9800 !important;
    font-weight: 500 !important;
}

#conversationInfo .limit-reached {
    color: #f44336 !important;
    font-weight: 600 !important;
}

/* Ocultar cualquier botón de conversaciones que pueda quedar */
button[onclick*="toggleSidebar"],
button[onclick*="loadConversations"],
.sidebar-toggle,
.conversation-toggle,
button:contains("📋"),
button:contains("conversaciones"),
button:contains("historial") {
    display: none !important;
    visibility: hidden !important;
}

/* Sidebar */
















/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
}

.modal-header button {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
}

.form-group textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.form-group input[type="range"] {
    width: 100%;
}

.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-primary {
    background: #0366FF;
    color: #FFFFFF;
    border: 1px solid #24A5F5;
}

.btn-primary:hover {
    background: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(6, 102, 255, 0.3);
}

.btn-secondary {
    background: #30CCF8;
    color: #080055;
    border: 1px solid #24A5F5;
}

.btn-secondary:hover {
    background: var(--accent-blue);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(48, 204, 248, 0.3);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.modal-header button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 1px var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .header-left,
    .header-center,
    .header .user-info {
        position: static;
        transform: none;
    }
    
    .header-center h1 {
        font-size: 1.2rem;
        text-align: center;
    }
    
    .chat-container {
        margin: 0.5rem;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    
    .user-info {
        flex-direction: column;
        gap: 0.5rem;
    }
}

