/* style.css - Estilos para Chat Web PvPGN Bot */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f0f0f0;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

/* Panel central - Chat */
.chat-container {
    width: 100%;
    max-width: 1000px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.chat-and-maps {
    display: flex;
    gap: 20px;
    flex: 1;
}

.chat-section {
    flex: 2;
    display: flex;
    flex-direction: column;
}

.chat-history {
    border: 2px solid #ddd;
    border-radius: 5px;
    height: 400px;
    overflow-y: auto;
    padding: 10px;
    background-color: #fafafa;
    margin-bottom: 20px;
    flex: 1;
}

.message {
    margin-bottom: 8px;
    padding: 5px;
    border-left: 3px solid #4CAF50;
    background-color: white;
    border-radius: 3px;
}

.message.auto-message {
    border-left-color: #ff9800;
    background-color: #fff3e0;
}

.message-time {
    font-size: 11px;
    color: #666;
    margin-right: 10px;
}

.message-text {
    color: #333;
}

.input-area {
    display: flex;
    gap: 10px;
}

#messageInput {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

#sendButton {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

#sendButton:hover {
    background-color: #45a049;
}

/* Panel derecho - Mapas */
.maps-panel {
    width: 300px;
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 3px solid #ffc107;
    height: fit-content;
    max-height: 500px;
    overflow-y: auto;
    box-sizing: border-box;
}

.maps-panel h3 {
    color: #ffc107;
    margin-top: 0;
    text-align: center;
    font-size: 16px;
    margin-bottom: 15px;
}

/* Sección del nombre del host */
.host-name-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ffc107;
}

.host-input-container {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
}

#hostNameInput {
    flex: 1;
    padding: 8px 10px;
    border: 2px solid #ffc107;
    border-radius: 5px;
    font-size: 12px;
    text-align: center;
    font-weight: bold;
    background-color: #fff9c4;
}

#hostNameInput:focus {
    outline: none;
    border-color: #ff9800;
    background-color: #ffeb3b;
}

#hostNameInput::placeholder {
    color: #999;
    font-style: italic;
}

#hostNameOk {
    padding: 8px 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    min-width: 35px;
}

#hostNameOk:hover {
    background-color: #45a049;
}

#hostNameOk:active {
    background-color: #3e8e41;
}

.host-status {
    font-size: 10px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.host-status.active {
    color: #4CAF50;
    font-weight: bold;
}

.maps-list {
    /* Removido: max-height y overflow-y */
}

.map-item {
    padding: 8px 12px;
    margin: 3px 0;
    background-color: #fff9c4;
    border-radius: 5px;
    border-left: 4px solid #ffc107;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    word-wrap: break-word;
}

.map-item:hover {
    background-color: #ffeb3b;
    transform: translateX(5px);
}

.map-item:active {
    background-color: #ffc107;
    color: white;
}

.no-messages {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

.no-maps {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .main-container {
        padding: 0;
        margin: 0;
    }
    
    .chat-container {
        margin: 0;
        padding: 15px;
        border-radius: 5px;
    }
    
    .chat-and-maps {
        flex-direction: column;
        gap: 15px;
    }
    
    .maps-panel {
        width: 100%;
        max-height: 300px;
        margin: 0;
        padding: 15px;
        border-radius: 5px;
        box-sizing: border-box;
    }
    
    .chat-history {
        height: 300px;
    }
    
    .map-item {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .maps-panel h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .host-input-container {
        flex-direction: row;
        gap: 5px;
    }
    
    #hostNameInput {
        font-size: 14px;
        padding: 10px;
    }
    
    #hostNameOk {
        font-size: 14px;
        padding: 10px 15px;
        min-width: 40px;
    }
    
    .host-status {
        font-size: 11px;
    }
    
    #messageInput {
        font-size: 16px; /* Evita zoom en iOS */
    }
}

/* Para pantallas muy pequeñas */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .chat-container {
        padding: 10px;
    }
    
    .maps-panel {
        border-width: 2px;
        padding: 10px;
    }
    
    .map-item {
        font-size: 12px;
        padding: 8px 10px;
    }
    
    h1 {
        font-size: 20px;
    }
    
    .maps-panel h3 {
        font-size: 16px;
    }
    
    #hostNameInput {
        font-size: 12px;
        padding: 8px;
    }
    
    #hostNameOk {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* Scrollbar personalizada para webkit browsers */
.chat-history::-webkit-scrollbar,
.maps-panel::-webkit-scrollbar {
    width: 8px;
}

.chat-history::-webkit-scrollbar-track,
.maps-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chat-history::-webkit-scrollbar-thumb,
.maps-panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.chat-history::-webkit-scrollbar-thumb:hover,
.maps-panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Estilos para mensajes especiales del chat log */

/* Mensajes /me - texto en gris */
.me-message {
    color: #888888;
    font-style: italic;
}

/* Comandos con . - texto en verde */
.command-message {
    color: #00aa00;
    font-weight: bold;
}

/* Texto en corchetes [texto] - verde */
.bracket-message {
    color: #CD5C5C;
    font-weight: bold;
}*/

/* Mensajes LOCAL - negro/gris */
.message-local .message-text {
    color: #333333;
}

/* Mensajes LOCAL - negro/gris */
.message-local .message-text {
    color: #333333;
}

/* Mensajes WHISPER - rosa + negrita */
.message-whisper .message-text {
    color: #FF1493;
    font-weight: bold;
}

/* Mensajes CHANNEL - azul + negrita */
.message-channel .message-text {
    color: #4169E1;
    font-weight: bold;
}

/* Mensajes EMOTE - púrpura + negrita */
.message-emote .message-text {
    color: #9932CC;
    font-weight: bold;
}

/* Mensajes INFO - verde + negrita */
.message-info .message-text {
    color: #228B22;
    font-weight: bold;
}

/* Mensajes LOCAL sin canal (como "Users in channel [2]: prueba71, slyhark") */
.message-local-direct {
    border-left-color: #17a2b8 !important;  /* Borde cian */
    background-color: #d4edda !important;   /* Fondo cian claro */
}

.message-local-direct .message-text {
    color: #0c5460;                          /* Texto cian oscuro */
    font-weight: normal;
}