/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #1a202c;
    color: #e2e8f0;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}

/* Contenedor principal del chat */
#chat-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 1200px;
    height: 800px;
    background-color: #2d3748;
    border: 2px solid #4a5568;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Título del chat */
h2 {
    text-align: center;
    padding: 15px;
    background-color: #1a202c;
    color: #e2e8f0;
    margin: 0;
    border-bottom: 2px solid #4a5568;
    font-size: 1.5em;
    font-weight: bold;
}

/* Área de mensajes */
#chat-box {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #1a202c;
    border-bottom: 1px solid #4a5568;
    max-height: calc(800px - 200px); /* Altura fija menos espacio para formulario y título */
}

/* Scrollbar personalizado */
#chat-box::-webkit-scrollbar {
    width: 8px;
}

#chat-box::-webkit-scrollbar-track {
    background: #2d3748;
}

#chat-box::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

#chat-box::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* Mensajes */
#chat-box p {
    margin: 8px 0;
    padding: 8px 12px;
    background-color: #2d3748;
    border-radius: 8px;
    border-left: 3px solid #4299e1;
    line-height: 1.4;
}

#chat-box p:hover {
    background-color: #374151;
}

.message-avatar {
    border: 1px solid #4a5568;
    background-color: #2d3748;
    object-fit: cover;
    display: inline-block;
}

/* Panel de emojis */
#emoji-panel {
    position: absolute;
    bottom: 80px;
    left: 10px;
    background-color: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 8px;
    padding: 10px;
    display: none;
    z-index: 1000;
    max-width: 300px;
    max-height: 200px;
    overflow-y: auto;
}

#emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.emoji-item {
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
    text-align: center;
}

.emoji-item:hover {
    background-color: #4a5568;
}

.emoji-item img {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

/* Formulario de mensaje */
#message-form {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #2d3748;
    border-top: 1px solid #4a5568;
    gap: 10px;
}

#emoji-btn {
    background-color: #4299e1;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

#emoji-btn:hover {
    background-color: #3182ce;
}

.message-input {
    flex: 1;
    background-color: #1a202c;
    border: 1px solid #4a5568;
    border-radius: 4px;
    padding: 10px;
    color: #e2e8f0;
    font-size: 14px;
    min-height: 40px;
    max-height: 100px;
    overflow-y: auto;
    outline: none;
    resize: none;
}

.message-input:focus {
    border-color: #4299e1;
}

.message-input[contenteditable="true"]:empty:before {
    content: attr(placeholder);
    color: #a0aec0;
    pointer-events: none;
}

/* Botón enviar */
.btn {
    background-color: #48bb78;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #38a169;
}

/* Emojis en mensajes */
.emoji {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin: 0 2px;
    display: inline-block;
}

/* Barra de usuario */
.user-bar {
    background-color: #2d3748;
    padding: 10px 15px;
    border-top: 1px solid #4a5568;
    color: #e2e8f0;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.user-bar a {
    color: #63b3ed;
    text-decoration: none;
    margin-left: auto;
}

.user-bar a:hover {
    color: #90cdf4;
    text-decoration: underline;
}

.character-avatar {
    border-radius: 4px;
    border: 1px solid #4a5568;
    background-color: #2d3748;
    object-fit: cover;
}

/* Responsive para pantallas pequeñas */
@media (max-width: 1200px) {
    #chat-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        border: none;
    }
    
    #chat-box {
        max-height: calc(100vh - 200px);
    }
}

/* Contenedor de login */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: #23263a;
    border-radius: 18px;
    box-shadow: 0 4px 32px #000a;
    padding: 40px 30px;
}

.login-container h2 {
    margin-top: 0;
    margin-bottom: 30px;
}

/* Formulario de login */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #a0aec0;
    font-weight: 500;
    font-size: 0.95em;
}

.form-group input {
    padding: 12px 16px;
    border: 1.5px solid #2d3148;
    border-radius: 8px;
    background: #1a1c25;
    color: #e3e6ed;
    font-size: 1em;
    font-family: 'Roboto', Arial, sans-serif;
    outline: none;
    transition: border 0.2s, background 0.2s;
}

.form-group input:focus {
    border: 1.5px solid #7f9cf5;
    background: #23263a;
}

/* Mensajes de error */
.error-message {
    color: #f56565;
    background: #2d1b1b;
    border: 1px solid #f56565;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 20px;
    font-size: 0.9em;
} 