/* ===== COMPONENTE: POST CARD ===== */
.post-card,
.post-card h3,
.post-card p {
  word-break: break-word;
  overflow-wrap: break-word;
}

.post-not-edited{
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #10ad2c;
  margin-bottom: 2px;
}
.post-edited {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fa2121;
  margin-bottom: 2px;
}
.username-label {
  font-size: 0.9rem;
  font-weight: normal;
  color: #666;
  margin-left: 8px;
  overflow: visible;
}


.post-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.post-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-color);
}

.post-title {
  margin: 0;
  font-size: 1.2rem;
}

.post-author {
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  font-size: 14px;
}

.post-body {
  line-height: 1.6;
  margin: 1rem 0;
}

.post-footer {
  /*display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  gap: 1rem; */

  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-date {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: right;
}

.post-actions {
  display: flex;
  gap: 0.5rem;
}

.post-author, .post-date{
  opacity:0.7;
}

/* ===== COMPONENTE: BUTTONS ===== */
.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary-color);
  background: var(--bg-tertiary);
}

.btn-small {
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  transition: all 0.2s ease;
}

.btn-small:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.btn-edit {
  background: rgba(29,161,242,0.08);
  color: #1da1f2;
  border-color: rgba(29,161,242,0.18);
}

.btn-edit:hover {
  background: rgba(29,161,242,0.12);
  color: #0d8ae6;
}

.btn-delete {
  background: rgba(224,36,94,0.07);
  color: #e0245e;
  border-color: rgba(224,36,94,0.14);
}

.btn-delete:hover {
  background: rgba(224,36,94,0.12);
  color: #c91c47;
}

/* ===== COMPONENTE: FORM GROUP ===== */
.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.form-label {
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-input {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 89, 152, 0.1);
}

.form-help {
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ===== COMPONENTE: NAV ===== */
nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
}

/* Asegura que la barra de navegación tenga altura consistente */
.navbar {
  height: 56px;
  align-items: center;
}

nav a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

nav a:hover {
  color: var(--primary-color);
}

/* ===== NAV BRAND ===== */
.nav-brand {
  flex: 1;
}

.nav-title {
  display: none;
  font-weight: 600;
  color: var(--text-primary);
}

/* Centered page title for profile */
.center-title {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  overflow: visible;
}

/* ===== NAV TOGGLE (HAMBURGER) ===== */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.3s ease;
  margin-left: auto;
}

.nav-toggle:hover {
  color: var(--primary-color);
}

/* ===== NAV MENU (MOBILE) ===== */
.nav-menu {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  position: static;
}

.nav-close {
  display: none;
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.3s ease;
}

.nav-close:hover {
  color: var(--primary-color);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-auth {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--primary-color);
}

/* ===== NAV BUTTONS MODERNOS ===== */
.nav-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Logout button styled as nav-link */
.logout-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  color: white;
}

.logout-btn:hover {
  color: #e0245e;
}

/* ===== LOGOUT MODAL ===== */
.logout-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.logout-modal {
  width: 100%;
  max-width: 400px;
  margin: 0 2rem;
}

.logout-modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
  text-align: center;
}

.logout-modal-content h2 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  color: var(--text-primary);
}

.logout-modal-content p {
  margin: 0 0 1.5rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.logout-modal-actions {
  display: flex;
  gap: 1rem;
}

.logout-btn-cancel {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-btn-cancel:hover {
  border-color: var(--primary-color);
  background: var(--bg-secondary);
}

.logout-btn-confirm {
  flex: 1;
  padding: 0.75rem 1rem;
  background: #e0245e;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-btn-confirm:hover {
  background: #c91c47;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(224, 36, 94, 0.3);
}

/* ===== SUCCESS MODAL ===== */
.success-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(34, 197, 94, 0.3); /* Semi-transparent green */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.success-modal {
  width: 100%;
  max-width: 400px;
  margin: 0 2rem;
}

.success-modal-content {
  background: var(--bg-secondary);
  border: 2px solid #22c55e; /* Green border */
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(34, 197, 94, 0.2);
  animation: slideUp 0.3s ease;
  text-align: center;
}

.success-modal-content h2 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  color: #22c55e; /* Green text */
}

.success-modal-content p {
  margin: 0 0 1.5rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.success-modal-actions {
  display: flex;
  justify-content: center;
}

.success-btn-ok {
  padding: 0.75rem 2rem;
  background: #22c55e;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.success-btn-ok:hover {
  background: #16a34a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.logout-btn-confirm:active {
  transform: translateY(0);
}

/* ===== RESPONSIVE - TABLET Y MOBILE ===== */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    max-width: 300px;
    height: 100vh;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 2rem;
    padding: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 200;
  }

  .nav-menu.active {
    transform: translateX(0);
  }

  .nav-close {
    display: block;
    align-self: flex-end;
    margin-bottom: 1rem;
  }

  .nav-links {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }

  .nav-auth {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }

  .nav-link {
    padding: 0.75rem;
    border-radius: 4px;
    display: block;
    width: 100%;
    transition: all 0.3s ease;
  }

  .nav-link:hover {
    background: var(--bg-secondary);
  }

  .dark-btn {
    width: 100%;
    padding: 0.75rem;
    border-radius: 4px;
    background: var(--bg-secondary);
    font-size: 1.25rem;
  }

  /* Hacer que nav-btn se vea como nav-link en responsive */
  .nav-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 4px;
    display: block;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .nav-btn:hover {
    background: var(--bg-secondary);
    transform: none;
    box-shadow: none;
  }
}

@media (max-width: 480px) {
  .nav-menu {
    max-width: 100%;
  }
}

.dark-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
}
/* ===== COMPONENTE: CHARACTER COUNTER ===== */
.character-counter {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

/* ===== TEXTAREA FIJO ===== */
textarea.form-input {
  resize: none;
  overflow-y: auto;
}

/* ===== BOTÓN DE EMOJI ===== */
.emoji-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2em;
  color: var(--text-secondary);
  padding: 5px;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.emoji-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ===== MODAL DE LOGOUT ===== */
.logout-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.logout-modal-content h2 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
}

.logout-modal-content p {
  margin: 0 0 1.5rem 0;
  color: var(--text-secondary);
}

.logout-modal-actions {
  display: flex;
  justify-content: center;
}

.logout-btn-cancel {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.logout-btn-cancel:hover {
  background: var(--primary-dark);
}

/* ===== FOOTER ===== */
.footer {
  display: flex;
  position: relative;
  overflow: visible;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: 50px;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  z-index: 99;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  min-height: 60px;
  font-size: 14px;
}


.footer-icon {
  
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.footer-icon:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.footer-icon:active {
  transform: translateY(0);
}


/* Ajuste para que el contenido no se oculte detrás del footer */
body {
  /*padding-bottom: 80px;*/
}

/* ===== COMPONENTE: LOADING ===== */
.loading {
  text-align: center;
  padding: 2rem;
  font-size: 1.2rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 1rem;
}