/* --- VARIABLES DE COLOR MSN --- */
:root {
    --msn-blue-light: #e3efff;
    --msn-blue-mid: #98c1e9;
    --msn-blue-dark: #4a89c7;
    --msn-border: #7199c5;
}

/* --- VENTANA PRINCIPAL --- */
.guestbook-window {
    width: 600px;
    height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

/* --- HEADER Y CONTROLES (Adaptados a tu HTML) --- */
.sobre-mi-img-header {
    width: 100%;
    height: 100%;
    object-fit: fill;
    /* fill para que cubra todo el espacio exacto */
    display: block;
    pointer-events: none;
}

.web-link-display {
    position: absolute;
    left: 10px;
    /* Movido a la derecha */
    top: 20px;
    color: #1e3a5f;
    font-size: 18px;
    font-weight: bold;
}

.win-btn {
    width: 25px;
    height: 18px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    color: #222;
    transition: background 0.2s;
}

.win-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.win-btn.close:hover {
    background: #e81123;
    color: white;
}

/* --- INFO DE CONTACTO (MSN HEADER) --- */
.msn-header {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgb(239, 244, 255);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.avatar-container {
    position: relative;
    width: 50px;
    height: 50px;
    background: white;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    flex-shrink: 0;
    overflow: hidden;
}


.status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    background: #4ec936;
    border: 2px solid white;
    border-radius: 50%;
}

.user-info .name {
    font-weight: bold;
    color: #1e3a5f;
    font-size: 14px;
    display: block;
}

.user-info .status-msg {
    font-size: 11px;
    color: #555;
    font-style: italic;
}

/* --- CUERPO (Historial de Conversación) --- */
.guestbook-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* El body no scrollea, scrollean los mensajes dentro */
    background: #f8fbff;
    padding: 0;
}

/* --- LISTA DE MENSAJES (Burbujas) con Scroll Propio --- */
.messages-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* Cambiado a normal para scroll natural */
    gap: 12px;
    overflow-y: auto;
    padding: 15px;
}

.message-item {
    background-color: white;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #c1d3e6;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.05);
    max-width: 90%;
    align-self: flex-start;
    animation: slideIn 0.3s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 4px;
    border-bottom: 1px solid #f0f5fa;
    padding-bottom: 2px;
}

.message-user {
    font-weight: bold;
    color: #1a5cad;
    /* Azul clásico de contactos MSN */
}

.message-date {
    color: #999;
    font-size: 10px;
}

.message-text {
    word-break: break-word;
    color: #333;
    line-height: 1.4;
    font-size: 13px;
}

/* --- FORMULARIO (Área de escritura) --- */
.guestbook-form {
    background: white;
    border-top: 1px solid #aac1d8;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    /* Asegura que no se encoja */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Barra de herramientas (Zumbido, Emojis) */
.msn-tools {
    display: flex;
    gap: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #f0f0f0;
}

.msn-tool-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    filter: grayscale(0.4);
    transition: filter 0.2s, transform 0.1s;
}

.msn-tool-btn:hover {
    filter: grayscale(0);
    transform: scale(1.1);
}

.guestbook-form input#gb-name {
    border: 1px solid #e0e0e0;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 3px;
    width: 100%;
}

.guestbook-form textarea#gb-text {
    border: none;
    padding: 5px;
    font-size: 13px;
    resize: none;
    height: 50px;
    outline: none;
    width: 100%;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guestbook-form button[type="submit"] {
    background: linear-gradient(to bottom, #ffffff 0%, #e0e0e0 100%);
    border: 1px solid #999;
    color: #333;
    padding: 4px 20px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.guestbook-form button[type="submit"]:hover {
    background: #f8f8f8;
    border-color: #666;
}

/* --- FOOTER (Mantenido) --- */
.web-footer {
    flex-shrink: 0;
    height: 30px;
    position: relative;
}

.web-img-footer {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
}

/* --- EFECTO ZUMBIDO --- */
@keyframes nudge {

    0%,
    100% {
        transform: translate(0, 0);
    }

    20% {
        transform: translate(-5px, -5px);
    }

    40% {
        transform: translate(5px, 5px);
    }

    60% {
        transform: translate(-5px, 5px);
    }

    80% {
        transform: translate(5px, -5px);
    }
}

.nudge-active {
    animation: nudge 0.3s ease-in-out;
}

.nudge-msg {
    text-align: center;
    color: #cc0000;
    font-weight: bold;
    font-style: italic;
    font-size: 11px;
    padding: 6px;
    background: #fff0f0;
    border-radius: 4px;
    border: 1px solid #ffcccc;
    margin: 5px 0;
}

.guestbook-body {
    scrollbar-width: thin;
    scrollbar-color: #c1d3e6 transparent;
}

.messages-list::-webkit-scrollbar {
    width: 8px;
}

.messages-list::-webkit-scrollbar-track {
    background: transparent;
}

/* Panel de Emojis */
.msn-tools {
    position: relative; /* Para que el panel se posicione respecto a la barra */
}

.emoji-picker {
    position: absolute;
    bottom: 35px;
    left: 20px;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    z-index: 100;
    border-radius: 4px;
}

.emoji-picker span {
    cursor: pointer;
    font-size: 20px;
    text-align: center;
    transition: transform 0.1s;
}

.emoji-picker span:hover {
    transform: scale(1.3);
}

.messages-list::-webkit-scrollbar-thumb {
    background: #c1d3e6;
    border-radius: 10px;
}