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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #0d0b14;
    color: #e8e2f5;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* layout general */
.estructura { display: flex; justify-content: center; min-height: 100vh; }

/* menu izquierdo */
.menu {
    width: 250px;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-right: 1px solid #2a2540;
    position: sticky;
    top: 0;
    height: 100vh;
}

.logo { padding: 10px 0 16px; }
.logo_header { height: 44px; }
.navegacion { display: flex; flex-direction: column; gap: 4px; }

.item-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 11px 15px;
    border-radius: 25px;
    color: #b8aed4;
    font-size: 17px;
    transition: background-color .2s, color .2s;
}

.item-menu:hover { background: #1c1730; color: #e8e2f5; }
.item-menu.activo { color: #c4b5fd; font-weight: 700; }
.icono { font-size: 20px; width: 24px; text-align: center; }
.texto { font-size: 17px; }

/* botones morados (compartido) */
.boton-contar-sueno,
.boton-iniciar-sesion,
.boton-publicar,
.boton-auth,
.btn-guardar,
.btn-comentar {
    background: #8c52ff;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s;
}

.boton-contar-sueno:hover,
.boton-iniciar-sesion:hover,
.boton-publicar:hover,
.boton-auth:hover,
.btn-guardar:hover,
.btn-comentar:hover { background: #7a3fe8; }

.boton-contar-sueno { width: 100%; padding: 13px; margin-top: 12px; font-size: 16px; }

.boton-iniciar-sesion {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 13px;
    margin-top: 4px;
    font-size: 16px;
}

.icono-sesion { width: 18px; height: 18px; flex-shrink: 0; }
.boton-publicar { padding: 9px 20px; font-size: 15px; }
.boton-auth { width: 100%; padding: 12px; font-size: 15px; font-family: inherit; }

/* columna central */
.contenido { width: 600px; border-left: 1px solid #2a2540; border-right: 1px solid #2a2540; }

.titulo-seccion {
    padding: 14px 20px;
    border-bottom: 1px solid #2a2540;
    font-size: 19px;
    font-weight: 700;
    color: #e8e2f5;
    position: sticky;
    top: 0;
    background: rgba(13,11,20,.85);
    backdrop-filter: blur(8px);
    z-index: 10;
}

/* caja para escribir un sueño */
.crear-tweet {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #2a2540;
    align-items: flex-start;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, #4c1d95, #7c3aed);
}

.area-tweet { flex: 1; display: flex; flex-direction: column; gap: 10px; }

.input-tweet {
    width: 100%;
    background: transparent;
    border: none;
    color: #e8e2f5;
    font-size: 17px;
    outline: none;
    resize: none;
    min-height: 60px;
    font-family: inherit;
}

.acciones-crear {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #2a2540;
    padding-top: 10px;
}

/* lista de sueños */
.tweets { display: flex; flex-direction: column; }

.tweet {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #1e1a30;
    transition: background-color .15s;
    cursor: pointer;
}

.tweet:hover { background: #110e1e; }

.avatar-tweet {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, #4c1d95, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}

.cuerpo-tweet { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nombre-usuario { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nombre { font-weight: 700; color: #e8e2f5; font-size: 15px; }
.arroba { color: #5a5070; font-size: 14px; }
.tiempo { color: #3d3558; font-size: 13px; }
.texto-tweet { font-size: 15px; color: #c0b8d8; line-height: 1.6; }
.hashtag-color { color: #a78bfa; font-weight: 700; }
.acciones-tweet { display: flex; gap: 24px; margin-top: 10px; font-size: 14px; }

.accion {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: color .15s;
    background: none;
    border: none;
    color: #4a4268;
    font-size: 14px;
    padding: 0;
    font-family: inherit;
}

.accion:hover, .accion.activo { color: #a78bfa; }

/* sidebar derecho */
.extras { width: 340px; padding: 10px 20px; display: flex; flex-direction: column; gap: 14px; }

.input-buscar {
    width: 100%;
    padding: 11px 18px;
    background: #16122a;
    border: 1px solid #2a2540;
    border-radius: 25px;
    color: #e8e2f5;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}

.card-aside { background: #110e1e; border: 1px solid #2a2540; border-radius: 16px; padding: 14px; }
.card-aside h3 { font-size: 17px; font-weight: 700; color: #e8e2f5; margin-bottom: 12px; }

.tendencia {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 0;
    border-bottom: 1px solid #1e1a30;
    cursor: pointer;
    transition: background .1s;
}

.tendencia:hover { background: #1a1530; margin: 0 -14px; padding: 10px 14px; border-radius: 8px; }
.tendencia:last-child, .sugerencia:last-child, .comentario:last-child { border-bottom: none; }
.categoria { font-size: 12px; color: #4a4268; }
.hashtag { font-size: 14px; font-weight: 700; color: #a78bfa; }
.num-tweets { font-size: 12px; color: #5a5070; }

.sugerencia { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #1e1a30; }

.avatar-pequeno {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e1b4b, #4338ca);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #c4b5fd;
    flex-shrink: 0;
}

.info-sugerencia { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.info-sugerencia .nombre { font-size: 14px; }
.info-sugerencia .arroba { font-size: 13px; }

.boton-seguir {
    padding: 6px 14px;
    background: transparent;
    color: #c4b5fd;
    border: 1px solid #5b4e8a;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s, color .2s;
    white-space: nowrap;
}

.boton-seguir:hover, .boton-seguir.siguiendo { background: #2a2251; color: #e8e2f5; }
.boton-seguir.siguiendo { border-color: #8c52ff; }

/* placeholders y focus (todos juntos para no repetir) */
.input-tweet::placeholder,
.input-buscar::placeholder,
.modal textarea::placeholder,
.form-editar textarea::placeholder,
.form-comentario input::placeholder,
.campo-auth::placeholder { color: #5a5070; }

.input-buscar:focus,
.campo-auth:focus,
.form-comentario input:focus,
.modal textarea:focus { border-color: #8c52ff; }

/* modal para publicar */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-overlay.abierto { display: flex; }

.modal {
    background: #0d0b14;
    border: 1px solid #2a2540;
    border-radius: 18px;
    padding: 28px;
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-header { display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 18px; font-weight: 700; color: #e8e2f5; }

.btn-cerrar {
    background: none;
    border: none;
    color: #5a5070;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    transition: color .2s;
}

.btn-cerrar:hover { color: #e8e2f5; }

.modal textarea {
    width: 100%;
    background: #16122a;
    border: 1px solid #2a2540;
    border-radius: 12px;
    padding: 14px;
    color: #e8e2f5;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    height: 130px;
    outline: none;
    transition: border-color .2s;
}

.modal-footer { display: flex; justify-content: flex-end; }

/* mensajes de error / éxito */
.alerta { padding: 12px 18px; border-radius: 10px; font-size: 14px; margin: 10px 20px; }
.alerta-error { background: #2d0a0a; border: 1px solid #7f1d1d; color: #fca5a5; }
.alerta-ok { background: #0a1a2d; border: 1px solid #1d4ed8; color: #93c5fd; }

/* página de perfil */
.perfil-header { padding: 20px; border-bottom: 1px solid #2a2540; display: flex; flex-direction: column; gap: 14px; }
.perfil-info { display: flex; align-items: center; gap: 16px; }

.avatar-perfil {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4c1d95, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.perfil-datos { display: flex; flex-direction: column; gap: 2px; }
.perfil-nombre { font-size: 20px; font-weight: 700; color: #e8e2f5; }
.perfil-arroba { font-size: 15px; color: #5a5070; }
.perfil-stats { display: flex; gap: 24px; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-size: 18px; font-weight: 700; color: #e8e2f5; }
.stat-label { font-size: 12px; color: #5a5070; }

/* botones editar y borrar sueño */
.tweet-acciones-editar { display: flex; gap: 10px; margin-top: 8px; }

.btn-editar, .btn-borrar {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
}

.btn-editar { background: #2a2251; color: #c4b5fd; border: 1px solid #5b4e8a; }
.btn-editar:hover { background: #3a2f6e; }
.btn-borrar { background: #2d0a0a; color: #fca5a5; border: 1px solid #7f1d1d; }
.btn-borrar:hover { background: #4a1212; }

/* formulario de edición inline */
.form-editar { display: none; flex-direction: column; gap: 8px; margin-top: 8px; }
.form-editar.abierto { display: flex; }

.form-editar textarea {
    background: #16122a;
    border: 1px solid #8c52ff;
    border-radius: 10px;
    padding: 10px 14px;
    color: #e8e2f5;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    height: 90px;
    outline: none;
}

.form-editar-acciones { display: flex; gap: 8px; justify-content: flex-end; }
.btn-guardar { padding: 7px 18px; border-radius: 20px; font-size: 14px; }

.btn-cancelar-editar {
    padding: 7px 18px;
    background: transparent;
    color: #5a5070;
    border: 1px solid #2a2540;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

.btn-cancelar-editar:hover { color: #e8e2f5; }

/* comentarios de cada sueño */
.seccion-comentarios { padding: 14px 20px; border-bottom: 1px solid #1e1a30; }
.seccion-comentarios h4 { font-size: 15px; color: #5a5070; margin-bottom: 10px; }
.comentario { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #1e1a30; }
.comentario-cuerpo { flex: 1; }
.comentario-autor { font-size: 13px; font-weight: 700; color: #c4b5fd; }
.comentario-texto { font-size: 14px; color: #c0b8d8; margin-top: 2px; }
.form-comentario { display: flex; gap: 10px; margin-top: 12px; align-items: center; }

.form-comentario input {
    flex: 1;
    background: #16122a;
    border: 1px solid #2a2540;
    border-radius: 20px;
    padding: 9px 16px;
    color: #e8e2f5;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
    font-family: inherit;
}

.btn-comentar { padding: 9px 16px; border-radius: 20px; font-size: 14px; white-space: nowrap; }

/* login y registro */
.pagina-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

.cajas-auth {
    display: flex;
    align-items: stretch;
    background: #110e1e;
    border: 1px solid #2a2540;
    border-radius: 20px;
    overflow: hidden;
}

.caja-auth { display: flex; flex-direction: column; gap: 16px; padding: 36px 32px; width: 300px; }
.divisor-auth { width: 1px; background: #2a2540; }
.logo-auth { height: 42px; display: block; margin: 0 auto 4px; }
.titulo-auth { font-size: 20px; font-weight: 700; color: #e8e2f5; text-align: center; }

.campo-auth {
    width: 100%;
    padding: 11px 16px;
    background: #16122a;
    border: 1px solid #2a2540;
    border-radius: 25px;
    color: #e8e2f5;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
    font-family: inherit;
}

.olvide-pass { font-size: 12px; color: #8c52ff; text-align: right; display: block; }
.olvide-pass:hover { text-decoration: underline; }

/* detalles notificaciones*/
.notif-vacia { padding: 60px 20px; text-align: center; color: #5a5070; }
.notif-icono { font-size: 48px; margin-bottom: 14px; }
.notif-titulo { font-size: 16px; color: #b8aed4; }
.notif-subtitulo { font-size: 14px; margin-top: 6px; }
.notif-tipo-icono { font-size: 22px; width: 32px; text-align: center; flex-shrink: 0; padding-top: 2px; }
.notif-avatar { width: 34px !important; height: 34px !important; font-size: 13px !important; }
.notif-extracto { font-size: 13px; color: #5a5070; margin-top: 4px; border-left: 2px solid #2a2540; padding-left: 10px; }
.tweet-no-link { cursor: default; }

/* detalles de perfil */
.titulo-con-back { display: flex; align-items: center; gap: 12px; }
.btn-back { color: #5a5070; font-size: 18px; }
.perfil-info-top { justify-content: space-between; align-items: flex-start; }
.perfil-bio { font-size: 14px; color: #b8aed4; margin-top: 6px; max-width: 340px; line-height: 1.5; }
.feed-vacio { padding: 40px 20px; text-align: center; color: #5a5070; }
.feed-vacio-icono { font-size: 36px; margin-bottom: 12px; }

/* detalles de publicacion */
.pub-detalle { padding: 18px 20px; border-bottom: 1px solid #2a2540; }
.pub-detalle-header { display: flex; gap: 12px; margin-bottom: 12px; }
.pub-detalle-texto { font-size: 18px; color: #e8e2f5; line-height: 1.7; margin-bottom: 16px; }
.pub-detalle-acciones { border-top: 1px solid #2a2540; padding-top: 12px; }
.comentario-login-aviso { font-size: 14px; color: #5a5070; margin-top: 12px; }
.comentario-login-aviso a { color: #a78bfa; }
/* preview del modal */
.preview-sueno { display: none; margin-top: 12px; border-top: 1px solid #2a2540; padding-top: 12px; }
.preview-sueno.visible { display: block; }
.preview-label { font-size: 12px; color: #5a5070; margin-bottom: 8px; }
.preview-tweet { pointer-events: none; border-bottom: none; padding: 10px 0 0; cursor: default; }
.preview-tweet:hover { background: transparent; }
.label-imagen { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #5a5070; margin-top: 4px; }
.label-imagen input[type="file"] { font-size: 13px; color: #b8aed4; cursor: pointer; }
#preview-img { display: none; max-width: 100%; border-radius: 12px; margin-top: 8px; }
/* imagenes publicadas */
.imagen-publicacion { max-width: 100%; border-radius: 14px; margin-top: 10px; border: 1px solid #2a2540; display: block; }
.imagen-publicacion-detalle { margin-bottom: 14px; }