
:root{
  --bg:#212f4f;
  --sidebar:#020617;
  --card:#131b27;
  --primary:#3b82f6;
  --muted:#bac1cc;
}
.card {
  background: var(--color-bg);
  color: var(--color-text);
}

a{
    text-decoration: none;
}

*{ box-sizing:border-box; }

.cine-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: #0b1424;
  overflow: hidden;
  pointer-events: none;
}

.cine-bg canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.18;
}

body{
  margin:0;
  font-family:'Manrope', 'Outfit', sans-serif;
  background:transparent;
  color:white;
  display:flex;
  min-height:100vh;
  position: relative;
  z-index: 1;
}

.sidebar{
  width:260px;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(12px);
  height: 100vh;
  min-height:100vh;
  padding:20px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  overflow-y:auto;
  border-right:1px solid rgba(59,130,246,0.15);
  position: sticky;
  top: 0;
  z-index: 2;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar {
  display: none; 
}

.perfil-btn{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px;
  background:var(--card);
  border-radius:10px;
  margin-bottom:20px;
  cursor:pointer;
  transition:background 0.2s;
}
.perfil-btn:hover{ background:#333c5f; }

.sb-item{
  margin:15px 0;
  color:var(--muted);
  cursor:pointer;
  transition:color 0.2s;
  display:flex;
  align-items:center;
  gap:10px;
}
.sb-item:hover{ color:white; }
.sb-item.active{
  color:white;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.35);
  padding: 10px 12px;
  border-radius: 10px;
}

.sb-discover{
  margin-top:8px;
  margin-bottom:6px;
}

.sb-icon{
  width:22px;
  height:22px;
  stroke:currentColor;
  stroke-width:2;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
  flex:0 0 auto;
}

.sb-section{ margin:25px 0; }
.type-section{ margin-top:32px; }
.sb-section-title{
  font-weight:600;
  margin-bottom:12px;
  font-size:0.85rem;
  color:white;
  text-transform:uppercase;
  letter-spacing:0.5px;
}

.type-filter{ display:flex; gap:8px; margin-bottom:20px; }
.type-btn{
  flex:1; padding:10px 12px; border-radius:8px;
  background:var(--card); cursor:pointer; text-align:center;
  font-size:0.9rem; transition:all 0.2s; border:1px solid transparent;
  color:var(--muted); font-weight:500;
}
.type-btn:hover{ background:#333c5f; }
.type-btn.active{ background:var(--primary); color:white; }

.pills{ display:flex; gap:8px; flex-wrap:wrap; }
.pill{
  padding:8px 12px; border-radius:20px; background:var(--card);
  cursor:pointer; font-size:0.85rem; transition:all 0.2s;
  border:1px solid transparent; color:var(--muted);
}
.pill:hover{ background:var(--primary); color:white; }
.pill.on{ background:var(--primary); color:white; }


.main{
  flex:1;
  display:flex;
  flex-direction:column;
  position: relative;
  z-index: 2;
}

.topbar{
  display:grid;
  grid-template-columns:auto minmax(0, 1fr) auto;
  align-items:center;
  padding:20px;
  border-bottom:1px solid rgba(9, 82, 201, 0.15);
  background: rgba(18, 28, 51, 0.7);
  backdrop-filter: blur(16px);
  gap:20px;
  position: relative;
  z-index: 30;
}

.topbar-left{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-width:0;
}

.topbar-actions {
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  gap:10px;
  min-width: max-content;
}

.logo-stack{ display:flex; align-items:center; gap:12px; flex:0 0 auto; }
.logo-mark{
  width:48px;
  height:48px;
  border-radius:12px;
  object-fit:contain;
  background:transparent;
}
.logo-text{ font-family:'Unbounded', 'Space Grotesk', sans-serif; font-size:2rem; font-weight:700; letter-spacing:1px; min-width:fit-content; color:white; }
.search-wrap{
  display:flex; align-items:center; gap:8px;
  background:var(--card); padding:10px 12px;
  border-radius:8px; width:min(100%, 520px);
  min-width:0;
  flex:0 1 auto;
  position:relative;
  z-index: 40;
  justify-self:center;
}

.theme-icon-toggle{
  position: relative;
}

.topbar .theme-toggle {
  position: static !important;
  top: auto !important;
  right: auto !important;
  z-index: auto !important;
  margin: 0;
}

.topbar .switch {
  margin: 0;
}

.search-wrap input{
  background:transparent; border:none; padding:0;
  color:white; width:100%; font-size:0.9rem; outline:none;
}
.search-wrap input::placeholder{ color:var(--muted); }

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(17, 24, 39, 0.55);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(111, 211, 255, 0.55);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.theme-icon-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.theme-icon.moon {
  display: none;
}

.theme-icon-toggle input:checked + .theme-toggle-btn .sun {
  display: none;
}

.theme-icon-toggle input:checked + .theme-toggle-btn .moon {
  display: inline-flex;
}

body.light-theme .theme-toggle-btn {
  background: #f7f9fd;
  border-color: #d9e1ed;
  color: #1f2f49;
}

.search-results{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  right:0;
  background:rgba(10,16,30,.96);
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  box-shadow:0 16px 36px rgba(0,0,0,.45);
  max-height:360px;
  overflow:auto;
  display:none;
  z-index:999;
}

.search-results.open{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:8px;
}

.sidebar {
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.sidebar-toggle-btn {
  display: none;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(17,24,39,.65);
  color: white;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 1.15rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.sidebar-toggle-btn:hover {
  background: rgba(59,130,246,.22);
  transform: translateY(-1px);
}

.sidebar-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
}


.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 15;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

body.sidebar-open .sidebar-backdrop {
  display: block;
  opacity: 1;
  visibility: visible;
}

body.sidebar-open .sidebar {
  transform: translateX(0) !important;
}

.search-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px;
  border-radius:10px;
  border:1px solid transparent;
}

.search-item:hover{
  background:rgba(59,130,246,.12);
  border-color:rgba(59,130,246,.35);
}

.search-item img,
.search-noimg{
  width:44px;
  min-width:44px;
  height:66px;
  border-radius:8px;
  object-fit:cover;
  border:1px solid rgba(255,255,255,.12);
}

.search-noimg{
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:.65rem;
  color:var(--muted);
  text-align:center;
}

.search-meta{
  display:flex;
  flex-direction:column;
  gap:2px;
  color:white;
}

.search-meta small,
.search-empty{
  color:var(--muted);
}

.search-empty{
  padding:10px;
}

.feed{
  flex:1;
  padding:20px;
  overflow-y:auto;
  position: relative;
  z-index: 1;
}

.feed-inner{
width:min(820px, 100%);
margin:0 auto;
display:flex;
flex-direction:column;
gap:16px;
padding-bottom:120px;
}

.feed-empty{
padding:18px 16px;
border-radius:16px;
border:1px solid var(--border);
background:rgba(255,255,255,.03);
color:var(--muted);
font-weight:700;
}

.feed-alert{
padding:14px 14px;
border-radius:16px;
border:1px solid var(--border);
background:rgba(255,255,255,.03);
font-weight:700;
}
.feed-alert.error{
border-color:rgba(255,107,107,.45);
background:rgba(255,107,107,.10);
color:#ffd0d0;
}

.post-card{
  background: rgba(30,41,59,0.85);
  backdrop-filter: blur(8px);
  padding:20px; border-radius:15px; margin-bottom:20px;
  transition:all 0.2s; border:1px solid transparent;
  overflow:hidden;
}
.post-card:hover{ transform:translateY(-2px); border-color:var(--primary); }

.post-head{
  display:flex; 
  align-items:center;
  margin-bottom:14px;
  gap: 10px;
  border-bottom: 1px solid #3a4a5c;
  padding-bottom: 12px;
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
  margin-right: 12px;
}
.post-info{ display:flex; flex-direction:column; gap:4px; }
.post-info{ min-width: 0; }
.post-title{ font-weight:bold; font-size:1.1rem; color:white; }
.post-author{ font-weight:bold; font-size:1.2rem; color:var(--primary); }
.post-date{ font-size:0.8rem; color:var(--muted); }
.post-title{
  font-weight:bold;
  font-size:1.1rem;
  color:white;
  /* Allow long titles to wrap instead of overflowing */
  overflow-wrap:anywhere;
  word-break:break-word;
  min-width: 0;
}
.post-body{
  color:var(--muted);
  margin-bottom:16px;
  line-height:1.5;
  font-size:0.95rem;
  /* Prevent long unbroken text from overflowing the card */
  overflow-wrap:anywhere;
  word-break:break-word;
  white-space:pre-wrap; /* keep newlines, allow wrapping */
}

.post-cats{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 14px;
}

.post-cat{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(17,24,39,.42);
  color:#d5e4fb;
  font-size:.82rem;
  font-weight:700;
  cursor:pointer;
  transition:all .18s;
}

.post-cat:hover{
  border-color:rgba(59,130,246,.5);
  background:rgba(59,130,246,.14);
}

/* Posible cambio: */
.post-media{
  display:flex;
  align-items:center;
  gap:12px;
  margin:0 0 14px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:12px;
  padding:10px;
  background:rgba(17,24,39,.35);
}

.post-media:hover{
  border-color:rgba(59,130,246,.5);
  background:rgba(59,130,246,.12);
}

.post-media-poster,
.post-media-poster.placeholder{
  width:54px;
  min-width:54px;
  height:82px;
  border-radius:8px;
  object-fit:cover;
  border:1px solid rgba(255,255,255,.12);
}

.post-media-poster.placeholder{
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  font-size:.7rem;
  text-align:center;
  padding:4px;
}

.post-media-meta{
  display:flex;
  flex-direction:column;
  gap:3px;
}

.post-media-kicker{
  color:#9ec4ff;
  font-size:.75rem;
  text-transform:uppercase;
  letter-spacing:.5px;
}

.post-media-meta strong{
  color:white;
  font-size:.95rem;
}

.post-media-meta span{
  color:var(--muted);
  font-size:.82rem;
}

.post-imgs{
  display:grid; grid-template-columns:1fr 1fr;
  gap:12px; margin-bottom:16px;
  border-radius:10px; overflow:hidden;
}
.post-img{
  width:100%; height:200px; object-fit:cover;
  border-radius:10px; cursor:pointer; transition:transform 0.2s;
}
.post-img:hover{ transform:scale(1.02); }

/* Posible cambio: */
.post-actions{
  display:flex; gap:16px; font-size:1.2rem;
  color:var(--muted); cursor:pointer;
}
.post-actions span{ transition:color 0.2s; }
.post-actions span:hover{ color:var(--primary); }

.create-post{
  position:fixed; bottom:20px; right:20px;
  width:55px; height:55px; border-radius:50%;
  background:var(--primary); display:flex;
  align-items:center; justify-content:center;
  font-size:2rem; cursor:pointer;
  box-shadow:0 4px 12px rgba(77, 131, 218, 0.4);
  transition:all 0.2s; border:none; color:white; z-index: 10;
}
.create-post:hover{
  transform:scale(1.1);
  box-shadow:0 6px 16px rgba(71, 128, 219, 0.6);
}

.icon-btn{
display:inline-flex;
align-items:center;
justify-content:center;
width:40px;
height:40px;
border-radius:12px;
border:1px solid rgba(255,255,255,.10);
background:rgba(17,24,39,.45);
color:rgba(237,241,247,.92);
cursor:pointer;
font-size:20px;
line-height:1;
transition:transform .2s, background .2s, border-color .2s, box-shadow .2s;
}

.icon-btn:hover{
transform:translateY(-1px);
border-color: rgba(111,211,255,.35);
background:rgba(17,24,39,.55);
box-shadow:0 8px 18px rgba(0,0,0,.25);
}

.btn-perfil{
display:flex;
align-items:center;
padding:6px 12px;
margin-left: 10px;
border-radius:12px;
border:1px solid rgba(255,255,255,.10);
background:rgba(17,24,39,.45);
font-size:15px;
line-height:1;
transition:transform .2s, background .2s, border-color .2s, box-shadow .2s;
}

.heart-icon{
width:22px;
height:22px;
display:block;
transform: translateY(0.5px);
}

.heart-path{
fill:none;
stroke:currentColor;
stroke-width:2;
}

.icon-btn.liked .heart-path{
fill:currentColor;
stroke:currentColor;
stroke-width:0;
}

.icon-btn.liked{
color:#ff6b6b;
border-color: rgba(255, 107, 107, 0.55);
background: rgba(255, 107, 107, 0.10);
}

.icon-btn.liked:hover{
border-color: rgba(255, 107, 107, 0.75);
background: rgba(255, 107, 107, 0.14);
}

.comments{
margin-top: 12px;
border-top: 1px solid rgba(255,255,255,0.08);
padding-top: 12px;
}

.comment-form{
display:flex;
flex-direction:column;
gap:10px;
margin-bottom: 12px;
}

.comment-input{
width:100%;
min-height: 74px;
resize:none;
border-radius: 12px;
border: 1px solid rgba(255,255,255,.10);
background: rgba(17,24,39,.45);
color: rgba(237,241,247,.92);
padding: 10px 12px;
outline:none;
}

.comment-input:focus{
border-color: rgba(111,211,255,.35);
box-shadow: 0 0 0 4px rgba(111, 211, 255, 0.12);
}

.comment-actions{
display:flex;
justify-content:flex-end;
}

.comment-send{
height: 38px;
padding: 0 14px;
border-radius: 12px;
border: 1px solid rgba(255,255,255,.10);
background: rgba(17,24,39,.55);
color: rgba(237,241,247,.95);
font-weight: 800;
cursor:pointer;
}

.comment-send:disabled{
opacity: .6;
cursor:not-allowed;
}

.comment-list{
display:flex;
flex-direction:column;
gap:10px;
}

.comment-item{
border: 1px solid rgba(255,255,255,0.08);
background: rgba(17,24,39,0.35);
border-radius: 12px;
padding: 10px 12px;
}

.comment-head{
display:flex;
justify-content:space-between;
gap:10px;
color: rgba(179, 192, 209, 0.95);
font-weight: 800;
font-size: .86rem;
margin-bottom: 6px;
}

.comment-body{
color: rgba(237, 241, 247, 0.92);
font-weight: 400;
line-height: 1.35;
}

@media(max-width:1024px){
  .sidebar{
    width:240px;
  }
  .feed-inner{
    width:min(700px, 100%);
  }
}

@media(max-width:768px){
  body{ 
    flex-direction:column; 
  }
  .sidebar{
    position: fixed;
    top: 72px;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 90vw;
    height: calc(100vh - 72px);
    margin: 0;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid rgba(59,130,246,0.15);
    border-bottom: none;
    background: rgba(2, 6, 23, 0.95);
    transform: translateX(-110%);
    z-index: 20;
    box-shadow: 12px 0 40px rgba(0,0,0,0.35);
    flex-direction: column;
    gap: 24px;
  }
  .sidebar-toggle-btn{
    display: inline-flex;
  }
  .main{
    min-height:auto;
  }
  .topbar{ 
    display:flex;
    flex-wrap:wrap; 
    justify-content:space-between;
    gap:14px;
    padding:15px;
    position: sticky;
    top: 0;
    z-index: 25;
    background: rgba(18, 28, 51, 0.92);
    backdrop-filter: blur(10px);
    align-items: center;
  }
  .topbar-left{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
  }
  .topbar-actions{
    display:flex;
    align-items:center;
    gap:10px;
  }
  .sidebar-toggle-btn{
    margin-left:0;
  }
  .theme-toggle{
    order: 0;
  }
  .logo-text{
    font-size:1.5rem;
  }
  .search-wrap{ 
    max-width:100%; 
    flex:1; 
    min-width:200px; 
  }
  .search-wrap input{
    font-size:0.85rem;
  }
  .feed{
    padding:15px;
  }
  .feed-inner{
    width:100%;
    gap:12px;
    padding-bottom:80px;
  }
  .post-imgs{ 
    grid-template-columns:1fr; 
  }
  .post-img{ 
    height:200px; 
  }
  .post-card{
    padding:15px;
    margin-bottom:12px;
  }
  .post-title{
    font-size:1rem;
  }
  .post-body{
    font-size:0.9rem;
    overflow-wrap:anywhere;
    word-break:break-word;
    white-space:pre-wrap;
  }
  .icon-btn{
    width:36px;
    height:36px;
    font-size:18px;
  }
  .create-post{
    width:48px;
    height:48px;
    font-size:1.5rem;
  }
  .topbar{
    gap:10px;
  }
  .tendencies{
    display:none;
  }
}

@media(max-width:480px){
  body{
    padding:0;
  }
  .sidebar{
    flex-wrap:wrap;
    gap:10px;
    padding:10px;
    overflow-x:auto;
    border-bottom:1px solid var(--card);
  }
  .sb-section{
    margin:10px 0;
    min-width:150px;
  }
  .topbar{
    flex-direction:column;
    align-items:stretch;
    padding:10px;
  }
  .topbar-left{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
  }
  .topbar-actions{
    display:flex;
    flex-wrap:nowrap;
    align-items:center;
    justify-content:flex-end;
    gap:10px;
    min-width: max-content;
  }
  .theme-toggle{
    align-self:auto;
    order: 0;
  }
  .logo-text{
    font-size:1.3rem;
    text-align:center;
  }
  .search-wrap{
    width:100%;
  }
  .feed{
    padding:10px;
  }
  .feed-inner{
    gap:10px;
  }
  .post-card{
    padding:12px;
    border-radius:10px;
  }
  .post-actions{
    font-size:1rem;
  }
}

.feed-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* 🔹 Card de publicación */
.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: center;
  width: 100%;
  max-width: 800px;
  background-color: var(--card);
  border-radius: 12px;
  padding: 25px 20px 70px; /* 🔹 más espacio inferior para el botón */
  margin-bottom: 25px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  overflow: visible;
  min-height: 280px; /* 🔹 altura mínima más natural */
}

/* 🔹 Botón de opciones abajo a la derecha */
.post-options {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 5;
}

/* 🔹 Botón de tres puntos */
.options-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 22px;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.options-btn:hover {
  color: #4da6ff;
  transform: scale(1.2);
}

/* 🔹 Menú desplegable */
.options-menu {
  display: none;
  position: absolute;
  bottom: 40px; /* 🔹 aparece justo encima del botón */
  right: 0;
  background-color: #1e1e2f;
  border: 1px solid #444;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  min-width: 180px;
  z-index: 10;
}

/* 🔹 Elementos del menú */
.option-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #ddd;
  text-align: left;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;
}

.option-item:hover {
  background-color: #2a2a3d;
}

/* 🔹 Ajuste de acciones */
.post-actions {
  display: flex;
  gap: 16px;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 15px;
}

.post-actions span {
  transition: color 0.2s;
}

.post-actions span:hover {
  color: var(--primary);
}

/* 🔹 Ajuste de media */
.post-media {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  padding: 10px;
  background: rgba(17,24,39,.35);
}