/* ==========================================================================
   CLOOST SOCIAL - STYLESHEET PRINCIPAL
   Diseñado fiel al boceto con estética suave, tarjetas curvadas y 100% responsivo
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Paleta de colores inspirada en la referencia */
  --primary-blue: #2A85FF;
  --primary-blue-hover: #1670E8;
  --sky-top: #A0C8F6;
  --sky-mid: #D3E6FA;
  --sky-light: #F4F8FD;
  --sky-bg: #E8F2FD;
  
  --bg-card: #FFFFFF;
  --bg-card-subtle: #F8FAFC;
  --bg-pill: #F1F5F9;
  --bg-dark-pill: #0F172A;
  
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-subtle: #94A3B8;
  --text-white: #FFFFFF;
  
  --verified-blue: #00BA7C;
  --badge-blue: #2A85FF;
  --heart-red: #F43F5E;
  --accent-purple: #8B5CF6;
  
  --radius-xs: 8px;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-pill: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.08);
  --shadow-floating: 0 20px 48px rgba(15, 23, 42, 0.16);
  
  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset y base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 220px, var(--sky-light) 600px, #F0F6FC 100%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}

/* Layout General */
.app-container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Header Superior (Móvil y Global con degradado suave hacia abajo) */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 500;
  background: linear-gradient(180deg, rgba(160, 200, 246, 0.98) 0%, rgba(160, 200, 246, 0.85) 65%, rgba(160, 200, 246, 0) 100%);
  padding: 12px 18px 24px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-normal);
  pointer-events: auto;
}

.top-nav-left, .top-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
  position: relative;
}

.nav-icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--primary-blue);
}

.nav-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.nav-notification-pill {
  height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-fast);
}

.nav-notification-pill:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Grilla Responsiva Principal (3 Columnas en Desktop) */
.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding: 16px;
  width: 100%;
  max-width: 100%;
  flex: 1;
  box-sizing: border-box;
}

/* Sidebar Izquierda (Desktop) */
.sidebar-left {
  display: none;
}

/* Feed Central */
.feed-content {
  width: 100%;
  max-width: 580px;
  min-width: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 95px; /* Espacio para barra flotante móvil */
  box-sizing: border-box;
}

/* Sidebar Derecha (Desktop) */
.sidebar-right {
  display: none;
}

/* ==========================================================================
   CARRUSEL DE HISTORIAS (STORIES BAR)
   ========================================================================== */
.stories-container {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 4px 14px 4px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE */
  box-sizing: border-box;
}

.stories-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  width: 76px;
  text-align: center;
  transition: transform var(--transition-fast);
}

.story-item:hover {
  transform: translateY(-3px);
}

.story-card-wrapper {
  position: relative;
  width: 72px;
  height: 96px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--bg-card);
  border: 2px solid transparent;
}

.story-card-wrapper.unseen {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(42, 133, 255, 0.3);
}

.story-img-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-author-avatar-mini {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-pill);
  border: 2px solid #FFF;
  object-fit: cover;
}

.story-your-wrapper {
  position: relative;
  width: 72px;
  height: 96px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(42, 133, 255, 0.4);
  box-shadow: var(--shadow-sm);
}

.story-your-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  margin-bottom: 2px;
}

.story-add-plus-badge {
  position: absolute;
  bottom: 12px;
  background: var(--primary-blue);
  color: #FFF;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  border: 2px solid #FFF;
}

.story-user-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 74px;
}

/* ==========================================================================
   CAJA DE CREAR PUBLICACIÓN RÁPIDA
   ========================================================================== */
.create-post-quick-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition-normal);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.create-post-quick-card:hover {
  box-shadow: var(--shadow-md);
}

.create-post-top-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  width: 100%;
}

.user-avatar-round {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  flex-shrink: 0;
}

.create-post-trigger-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-pill);
  border-radius: var(--radius-pill);
  padding: 12px 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.create-post-trigger-input:hover {
  background: #E2E8F0;
  color: var(--text-main);
}

.create-post-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid #F1F5F9;
  width: 100%;
  min-width: 0;
  gap: 6px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition-fast);
  min-width: 0;
  white-space: nowrap;
}

.quick-action-btn:hover {
  background: var(--bg-pill);
  color: var(--primary-blue);
}

.quick-action-btn.anonymous-btn:hover {
  color: var(--accent-purple);
}

.quick-action-btn.business-btn:hover {
  color: #059669;
}

/* ==========================================================================
   TARJETA DE PUBLICACIÓN (POST CARD) - IDÉNTICA A LA REFERENCIA
   ========================================================================== */
.post-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.post-card:hover {
  box-shadow: var(--shadow-md);
}

/* Cabecera del post */
.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.post-author-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.post-author-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.post-author-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.post-author-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.verified-badge-icon {
  color: var(--primary-blue);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.business-tag-badge {
  font-size: 0.72rem;
  background: #E0F2FE;
  color: var(--primary-blue);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 700;
}

.anonymous-tag-badge {
  font-size: 0.72rem;
  background: #F3E8FF;
  color: var(--accent-purple);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 700;
}

.post-sub-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.post-category-pill {
  background: var(--bg-pill);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid #E2E8F0;
  transition: var(--transition-fast);
  flex-shrink: 0;
  white-space: nowrap;
}

.post-category-pill:hover {
  background: #E2E8F0;
}

/* Galería de imágenes superpuestas / apiladas estilo boceto */
.post-media-stack {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  perspective: 1000px;
  overflow: hidden;
}

.stack-card-left {
  position: absolute;
  left: 4%;
  width: 58%;
  height: 230px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transform: rotate(-7deg) scale(0.92);
  z-index: 1;
  transition: var(--transition-normal);
  cursor: pointer;
}

.stack-card-right {
  position: absolute;
  right: 4%;
  width: 58%;
  height: 230px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transform: rotate(7deg) scale(0.92);
  z-index: 1;
  transition: var(--transition-normal);
  cursor: pointer;
}

.stack-card-center {
  position: relative;
  width: 66%;
  height: 260px;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  z-index: 2;
  transition: var(--transition-normal);
  cursor: pointer;
}

.post-media-stack:hover .stack-card-left {
  transform: rotate(-10deg) translateX(-15px) scale(0.95);
}

.post-media-stack:hover .stack-card-right {
  transform: rotate(10deg) translateX(15px) scale(0.95);
}

.post-media-stack:hover .stack-card-center {
  transform: scale(1.03);
}

.post-media-single {
  width: 100%;
  max-height: 380px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.media-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Contenido de texto */
.post-text-content {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.6;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Barra inferior de interacción y botones pill */
.post-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.post-stats-pill-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-pill);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.stat-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  padding: 4px 6px;
  border-radius: var(--radius-pill);
  transition: var(--transition-fast);
}

.stat-action-btn:hover {
  color: var(--primary-blue);
}

.stat-action-btn.liked {
  color: var(--heart-red);
}

.stat-action-btn.liked svg {
  fill: var(--heart-red);
}

.post-comment-input-pill {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-pill);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.post-comment-input-pill svg {
  flex-shrink: 0;
}

.post-comment-input-pill span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.post-comment-input-pill:hover {
  background: #E2E8F0;
  color: var(--text-main);
}

.post-more-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--bg-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.post-more-btn:hover {
  background: #E2E8F0;
  color: var(--text-main);
}

/* ==========================================================================
   BARRA DE NAVEGACIÓN FLOTANTE INFERIOR (MÓVIL - IDENTICA AL BOCETO)
   ========================================================================== */
.floating-bottom-nav-container {
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 900;
  pointer-events: none;
  padding: 0 16px;
}

.floating-bottom-nav {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px;
  border-radius: var(--radius-pill);
}

.nav-circle-btn {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-pill);
  background: var(--bg-dark-pill);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.nav-circle-btn:hover {
  transform: scale(1.08);
}

.nav-circle-btn.blue-action {
  background: var(--primary-blue);
}

.nav-circle-btn.blue-action:hover {
  background: var(--primary-blue-hover);
}

.nav-pill-active-btn {
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  background: var(--bg-dark-pill);
  color: #FFF;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast);
}

.nav-pill-active-btn:hover {
  transform: scale(1.05);
}

/* ==========================================================================
   ESTILOS DE ESCRITORIO Y TABLET (RESPONSIVE)
   ========================================================================== */
@media (min-width: 900px) {
  .main-layout {
    grid-template-columns: 240px minmax(0, 1fr);
    padding: 24px 20px;
  }
  
  .sidebar-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 80px;
    height: fit-content;
  }
  
  .feed-content {
    margin: 0;
    max-width: 100%;
    padding-bottom: 30px;
  }
  
  .floating-bottom-nav-container {
    display: none; /* En desktop usamos la barra lateral */
  }
}

@media (min-width: 1200px) {
  .main-layout {
    grid-template-columns: 260px minmax(0, 1fr) 340px;
    gap: 28px;
  }
  
  .sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 80px;
    height: fit-content;
  }
}

/* Componentes de Sidebar Izquierda (Desktop) */
.sidebar-nav-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand-logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 18px 14px;
  border-bottom: 1px solid #F1F5F9;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-blue), #60A5FA);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(42, 133, 255, 0.35);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.sidebar-nav-link:hover {
  background: var(--bg-pill);
  color: var(--primary-blue);
  transform: translateX(3px);
}

.sidebar-nav-link.active {
  background: var(--bg-dark-pill);
  color: #FFF;
}

.sidebar-nav-link .badge-counter {
  margin-left: auto;
  background: var(--primary-blue);
  color: #FFF;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.btn-sidebar-post {
  background: var(--primary-blue);
  color: #FFF;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 20px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(42, 133, 255, 0.35);
  margin-top: 10px;
  transition: var(--transition-fast);
}

.btn-sidebar-post:hover {
  background: var(--primary-blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(42, 133, 255, 0.45);
}

/* Perfil resumen en sidebar */
.sidebar-user-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.sidebar-user-info:hover {
  opacity: 0.85;
}

.sidebar-user-info:hover span:first-child {
  color: var(--primary-blue);
}

/* Componentes de Sidebar Derecha (Widgets) */
.widget-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.widget-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trend-item {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border-bottom: 1px solid #F8FAFC;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.trend-item:hover {
  transform: translateX(4px);
}

.trend-category {
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-weight: 600;
}

.trend-tag {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.trend-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.follow-suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
}

.follow-user-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-follow {
  background: var(--bg-dark-pill);
  color: #FFF;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  transition: var(--transition-fast);
}

.btn-follow:hover {
  background: var(--primary-blue);
}

.btn-follow.following {
  background: var(--bg-pill);
  color: var(--text-main);
  border: 1px solid #CBD5E1;
}
