/* estilos.css */

/* RESET BÁSICO */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* TIPOGRAFÍA Y FONDO */
body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.5;
}

/* CONTENEDOR PRINCIPAL */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* NAVEGACIÓN */
nav {
  margin-bottom: 20px;
}
nav a {
  margin-right: 15px;
  color: #007bff;
  text-decoration: none;
}
nav a:hover {
  text-decoration: underline;
}

/* FORMULARIOS */
form {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 30px;
}
form textarea,
form input[type="text"],
form input[type="email"],
form input[type="password"],
form select {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
form button {
  display: inline-block;
  padding: 10px 20px;
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
form button:hover {
  background: #218838;
}

/* ERRORES Y ÉXITOS */
.error {
  color: #dc3545;
  margin-top: 8px;
}
.exito {
  color: #28a745;
  margin-top: 8px;
}

/* FEED DE PUBLICACIONES */
.feed {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* CADA POST */
.post {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.post p {
  margin-bottom: 10px;
}

/* IMÁGENES EN PUBLICACIONES: ancho máximo y altura limitada */
.post img {
  display: block;
  max-width: 100%;
  /* Si quieres forzar altura uniforme, descomenta estas dos líneas: */
  /* max-height: 300px; */
  /* object-fit: cover; */
  height: auto;
  margin: 10px 0;
  border-radius: 4px;
}

/* PIES DE FOTO */
.post small {
  color: #666;
  display: block;
  margin-top: 8px;
}

/* PAGINACIÓN */
.pagination {
  text-align: center;
  margin: 20px 0;
}
.pagination a {
  margin: 0 5px;
  padding: 6px 12px;
  color: #007bff;
  text-decoration: none;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.pagination a:hover {
  background: #f1f1f1;
}
.pagination strong {
  margin: 0 5px;
  padding: 6px 12px;
  border: 1px solid #007bff;
  background: #007bff;
  color: #fff;
  border-radius: 4px;
}

body.login-bg, html {
  min-height: 100vh;
  margin: 0;
  font-family: 'Segoe UI', 'Montserrat', 'Arial', sans-serif;
  background: radial-gradient(ellipse 70% 60% at 80% 40%, #37b877 0%, #09335c 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Fondo extra de curvas suave */
.login-hero-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at 80% 40%, #37b87755 0, #09335c00 70%),
              radial-gradient(circle at 20% 90%, #18538266 0, #09335c00 85%);
}

.login-main {
  position: relative;
  z-index: 1;
  min-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Card login principal */
.login-card {
  background: #f4f8fb;
  display: flex;
  flex-direction: row;
  border-radius: 24px;
  box-shadow: 0 8px 28px rgba(9, 51, 92, 0.10), 0 1.5px 12px rgba(44,184,112,0.11);
  overflow: hidden;
  max-width: 890px;
  width: 98vw;
  min-height: 410px;
}

/* Columna imagen — más grande (ajuste aquí) */
.login-image-col {
  width: 57%;
  min-width: 340px;
  min-height: 430px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eaf4fa;
  border-top-left-radius: 22px;
  border-bottom-left-radius: 22px;
  padding: 18px 8px 18px 28px;
}
.login-img {
  width: 98%;
  max-height: 370px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(44,184,112,0.08);
}

/* Columna formulario */
.login-form-col {
  flex: 1;
  min-width: 270px;
  padding: 42px 42px 32px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
}
.login-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.login-logo {
  width: 62px;
  height: auto;
}
.login-title {
  font-size: 1.2rem;
  color: #11497b;
  font-weight: 600;
  line-height: 1.2;
}
.login-subtitle {
  font-size: 1rem;
  font-weight: 400;
  margin-top: 2px;
  color: #217b56;
}
.error {
  color: #ce2d2d;
  background: #ffeced;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 1rem;
}
.form-group {
  margin-bottom: 18px;
}
.login-input {
  width: 100%;
  padding: 13px 14px;
  font-size: 1rem;
  border: 1.5px solid #c7e5d5;
  border-radius: 9px;
  background: #f7fdf9;
  outline: none;
  transition: border 0.2s;
  font-family: inherit;
}
.login-input:focus {
  border-color: #37b877;
  background: #fff;
}

.login-btn {
  width: 100%;
  padding: 13px 0;
  font-size: 1.12rem;
  color: #fff;
  background: #37b877;
  border: none;
  border-radius: 9px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: .02em;
}
.login-btn:hover,
.login-btn:focus {
  background: #217b56;
}

.login-links {
  margin-top: 8px;
  font-size: .98rem;
  text-align: right;
}
.login-links a {
  color: #1872ad;
  text-decoration: underline;
  transition: color 0.15s;
}
.login-links a:hover {
  color: #35b96e;
}
.login-footer {
  margin-top: 32px;
  color: #e2eaf2;
  text-align: center;
  font-size: .99rem;
  letter-spacing: .01em;
}

/* Recaptcha */
.recaptcha-row {
  display: flex;
  justify-content: center;
}

@media (max-width: 920px) {
  .login-card { flex-direction: column; max-width: 98vw; }
  .login-image-col, .login-form-col {
    border-radius: 0; min-width: 0; width: 100%;
    padding-left: 14px; padding-right: 14px;
  }
  .login-img { max-height: 180px; width: 98%; }
  .login-form-col { padding-top: 22px; }
  .login-footer { margin-top: 12px; }
}
@media (max-width: 650px) {
  .login-card { min-height: unset; }
  .login-main { min-height: 92vh; }
}



.main-navbar {
  background: #23272f;
  padding: 0.3em 0;
  border-bottom: 1.5px solid #2a3140;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 8px #0b19334b;
}
.main-navbar ul {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0; padding: 0;
  list-style: none;
  gap: 2.5em;
}
.main-navbar li { display: flex; }
.main-navbar a {
  display: flex; flex-direction: column; align-items: center; 
  color: #b2b6c6;
  text-decoration: none;
  font-size: 0.98em;
  font-weight: 500;
  padding: 0.1em 0.7em 0.2em 0.7em;
  border-radius: 0.7em;
  transition: color 0.2s, background 0.2s;
  position: relative;
}
.main-navbar a svg {
  width: 1.6em; height: 1.6em; margin-bottom: 0.15em;
  stroke: #b2b6c6; fill: none;
  display: block;
  transition: stroke 0.23s;
}
.main-navbar a.active,
.main-navbar a:hover {
  color: #2196f3;
  background: #131820;
}
.main-navbar a.active svg,
.main-navbar a:hover svg {
  stroke: #2196f3;
}
.main-navbar a.active:after {
  content: "";
  display: block;
  position: absolute;
  left: 35%; right: 35%; bottom: -4px;
  height: 2.5px;
  background: #2196f3;
  border-radius: 2px;
  box-shadow: 0 1px 3px #2196f375;
}
.main-navbar span {
  font-size: .89em;
  margin-top: -0.12em;
  letter-spacing: 0.03em;
}
@media (max-width: 700px) {
  .main-navbar ul { gap: 1em; }
  .main-navbar span { display:none; }
}

body.feed-bg {
  background: radial-gradient(circle at 70% 30%, #38b6ff 0, #1e3653 60%, #142035 100%);
  min-height: 100vh;
  font-family: 'Segoe UI', Arial, sans-serif;
}

.feed-main {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}
.feed-col {
  background: #f4f7fa;
  border-radius: 1.5rem;
  box-shadow: 0 8px 32px #17335c18;
  max-width: 960px;
  width: 100%;
  padding: 2rem 2rem 1rem 2rem;
  margin: 1rem;
}
.feed-title-row {
  display: flex; align-items: center; gap: 0.7em; margin-bottom: 1em;
}
.feed-logo {
  height: 32px;
  margin-right: .6em;
}
.post-form {
  background: #f4f7fa;
  border-radius: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 8px #17335c11;
  padding: 1rem 1rem 0.7rem 1rem;
}
.post-input {
  width: 100%; resize: none; font-size: 1.1em; border-radius: 10px; border: 1px solid #d7e5f1; padding: .8em; margin-bottom: .7em;
  background: #fff;
}
.post-form-actions {
  display: flex; align-items: center; gap: 1em; justify-content: flex-end;
}
.btn-green {
  background: #22bb5b;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6em 1.3em;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  transition: background .2s;
}
.btn-green:hover { background: #1b9448; }
.file-label { cursor:pointer; color: #1567b6; }
.file-label input[type="file"] { display:none; }

.feed-list { margin: 0; padding: 0; }
.post-card {
  background: #e8f1f7;
  border-radius: 1.2em;
  margin-bottom: 1.3em;
  box-shadow: 0 4px 16px #17335c0d;
  padding: 0.5em 1em 0.7em 0.5em;
  display: flex;
}
.post-own { background: #d0f6e2; }
.post-row { display: flex; }
.post-avatar {
  margin: .7em 1em 0 .5em;
}
.avatar-circle {
  display: block;
  background: #18a1b6;
  color: #fff;
  font-weight: bold;
  font-size: 1.2em;
  border-radius: 100%;
  width: 2.3em; height: 2.3em;
  text-align: center; line-height: 2.3em;
}
.post-body { flex: 1; }
.post-author { font-weight: bold; color: #18345b; }
.post-time { font-size: .95em; color: #888; margin-left: .7em; }
.post-bubble {
  background: #fff;
  border-radius: 18px;
  margin: 0.3em 0 0.2em 0;
  padding: 1em 1.2em;
  box-shadow: 0 1px 7px #bbb3;
  min-height: 30px;
  font-size: 1.1em;
}
.post-img { max-width: 720px; max-height: 620px; border-radius: 14px; margin: 0.7em 0; display:block; }
footer { margin-top: .7em; font-size: .92em; color: #6c818f; }
.post-delete { display:inline; margin-left: .7em; }
.post-delete button {
  background: none; border: none; font-size: 1.15em; cursor: pointer; color: #ce3333;
  transition: color .15s;
}
.post-delete button:hover { color: #e60000; }

.alert { padding: .7em 1em; border-radius: .8em; margin-bottom: .7em; font-size: 1em; }
.alert.success { background: #dafbe6; color: #197745; }
.alert.error { background: #ffe6e6; color: #a72222; border: 1px solid #e36d6d; }
.pagination { text-align:center; margin-top:1em; }
.pagination a, .pagination strong { margin: 0 .2em; padding: .3em .7em; border-radius: .5em; text-decoration:none; }
.pagination a { background: #e7effa; color: #0e466b; }
.pagination strong { background: #22bb5b; color: #fff; }


body.msg-bg {
  background: radial-gradient(circle at 60% 40%, #38b6ff 0, #1e3653 60%, #142035 100%);
  min-height: 100vh;
  font-family: 'Segoe UI', Arial, sans-serif;
}
.msg-main {
  display: flex;
  justify-content: center;
  padding: 2.5rem 0;
}
.msg-panel {
  background: #f5fafd;
  border-radius: 1.5rem;
  box-shadow: 0 8px 32px #17335c14;
  max-width: 500px;
  width: 100%;
  padding: 2rem 2rem 1rem 2rem;
  margin: 1rem;
}
.msg-logo {
  height: 1.8em;
  vertical-align: middle;
  margin-right: .5em;
  filter: drop-shadow(0 2px 0 #22bb5b30);
}
.msg-section-title { 
  font-size: 1.13em; 
  margin: 2em 0 1em 0; 
  color: #2078c7; 
  font-weight: 700; 
  letter-spacing: .5px;
}
.msg-form {
  background: #fff;
  border-radius: 1em;
  box-shadow: 0 1px 8px #17335c0e;
  padding: 1rem 1rem 1rem 1rem;
  margin-bottom: 1em;
  display: flex;
  flex-direction: column;
  gap: 0.8em;
}
.msg-form-to {
  position: relative;
}
.msg-form-to input[type="text"] {
  width: 100%;
  padding: .7em 1em;
  border-radius: 7px;
  border: 1px solid #c4d7ec;
  font-size: 1.09em;
}
.autocomplete-suggestions {
  position: absolute;
  top: 110%;
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #b0d4f8;
  border-radius: 0 0 9px 9px;
  box-shadow: 0 4px 12px #19528c19;
  z-index: 10;
}
.autocomplete-suggestions div {
  padding: .6em 1em;
  cursor: pointer;
  font-size: 1em;
  color: #0e466b;
}
.autocomplete-suggestions div:hover {
  background: #c3edff;
}
.msg-form-body textarea {
  width: 100%;
  min-height: 70px;
  max-height: 200px;
  padding: .8em 1em;
  border-radius: 7px;
  border: 1px solid #c4d7ec;
  font-size: 1.09em;
  resize: vertical;
  background: #f9fbfd;
}
.msg-form-actions {
  display: flex;
  justify-content: flex-end;
}
.btn-green {
  background: #22bb5b;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6em 1.3em;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  transition: background .2s;
}
.btn-green:hover { background: #1b9448; }
.alert { padding: .7em 1em; border-radius: .8em; margin-bottom: .7em; font-size: 1em; }
.alert.success { background: #dafbe6; color: #197745; }
.alert.error { background: #ffe6e6; color: #a72222; border: 1px solid #e36d6d; }

.msg-feed { 
  display: flex; 
  flex-direction: column; 
  gap: 1.1em; 
  margin-bottom: 1.5em; 
}
.msg-item {
  display: flex; align-items: flex-start; gap: 1em;
}
.msg-avatar {
  background: #18a1b6;
  color: #fff;
  font-weight: bold;
  font-size: 1.17em;
  border-radius: 100%;
  width: 2.3em; height: 2.3em;
  text-align: center; line-height: 2.3em;
  margin-top: .1em;
  box-shadow: 0 1px 6px #17335c18;
}
.msg-bubble {
  background: #fff;
  border-radius: 1.2em;
  padding: 1em 1.2em .7em 1.2em;
  box-shadow: 0 2px 12px #38b6ff17;
  min-width: 0;
  max-width: 80vw;
  font-size: 1.1em;
  word-break: break-word;
  flex: 1;
}
.msg-from { font-weight: 700; color: #2281c9; margin-right: 1em; }
.msg-date { font-size: .98em; color: #7c8996; }
.msg-content { margin: 0.7em 0 0 0; }
.msg-empty {
  text-align: center;
  color: #a0adb9;
  font-size: 1.12em;
  margin: 2em 0 2em 0;
}

.pagination { text-align:center; margin-top:1em; }
.pagination a, .pagination strong { margin: 0 .2em; padding: .3em .7em; border-radius: .5em; text-decoration:none; }
.pagination a { background: #e7effa; color: #0e466b; }
.pagination strong { background: #22bb5b; color: #fff; }

@media (max-width: 700px) {
  .msg-panel { max-width: 99vw; padding: 1.3rem 0.4rem 1rem 0.4rem;}
  .msg-bubble { max-width: 99vw; }
}

body.admin-bg {
  background: radial-gradient(circle at 60% 40%, #38b6ff 0, #1e3653 70%, #142035 100%);
  min-height: 100vh;
  font-family: 'Segoe UI', Arial, sans-serif;
}
.admin-main {
  display: flex;
  justify-content: center;
  padding: 2.5rem 0;
}
.admin-panel {
  background: #f5fafd;
  border-radius: 1.5rem;
  box-shadow: 0 8px 32px #17335c19;
  max-width: 950px;
  width: 100%;
  padding: 2rem 2rem 1rem 2rem;
  margin: 1rem;
}
.admin-logo {
  height: 2.1em;
  vertical-align: middle;
  margin-right: .5em;
  filter: drop-shadow(0 2px 0 #22bb5b40);
}
.alert { padding: .7em 1em; border-radius: .8em; margin-bottom: .7em; font-size: 1em; }
.alert.success { background: #dafbe6; color: #197745; }
.alert.error { background: #ffe6e6; color: #a72222; border: 1px solid #e36d6d; }

.admin-table-wrap {
  overflow-x: auto;
  background: #e8f1f7;
  border-radius: 1.2rem;
  margin: 1.5em 0 2em 0;
  box-shadow: 0 4px 24px #17335c09;
}
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 1.09em;
  min-width: 600px;
}
.admin-table th, .admin-table td {
  padding: 0.85em 1.1em;
  text-align: left;
  border-bottom: 1px solid #e3eaf0;
}
.admin-table th {
  background: #f2f6fc;
  color: #1972bb;
  font-weight: 700;
  border-radius: 0;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-avatar {
  background: #18a1b6;
  color: #fff;
  font-weight: bold;
  font-size: 1.1em;
  border-radius: 100%;
  width: 2em; height: 2em;
  text-align: center; line-height: 2em;
  margin-right: .5em;
  display: inline-block;
  vertical-align: middle;
  box-shadow: 0 1px 6px #17335c10;
}
.admin-role {
  padding: .2em .8em;
  border-radius: 12px;
  font-size: 1em;
  font-weight: 600;
  text-transform: capitalize;
}
.role-admin { background: #e7f8f1; color: #138a4a; border: 1px solid #3cd47a60;}
.role-user { background: #f1f4fd; color: #226cae; border: 1px solid #94befb50; }
.admin-delete-form { display:inline; }
.btn-red {
  background: #ffe6e6;
  color: #c22727;
  border: none;
  border-radius: 7px;
  padding: .5em 1em;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  margin-left: .3em;
  box-shadow: 0 1px 5px #d0000022;
}
.btn-red:hover { background: #e53935; color: #fff; }
.admin-self {
  font-size: .99em;
  color: #797979;
  font-style: italic;
  padding: .3em 1em;
}
.admin-links {
  margin: 2em 0 0 0; text-align: right;
}
.btn-back {
  color: #167db7;
  background: #e6f4fa;
  border-radius: 8px;
  padding: .6em 1.2em;
  font-weight: 500;
  text-decoration: none;
  font-size: 1em;
  transition: background .14s;
  border: none;
}
.btn-back:hover { background: #bbf0f9; color: #085c87; }

@media (max-width: 800px) {
  .admin-panel { max-width: 98vw; padding: 1.2rem 0.3rem 1rem 0.3rem;}
  .admin-table { min-width: 420px; font-size: 0.97em;}
}

body.perfil-bg {
  background: radial-gradient(circle at 70% 20%, #38b6ff 0, #1e3653 60%, #142035 100%);
  min-height: 100vh;
  font-family: 'Segoe UI', Arial, sans-serif;
}

.perfil-main {
  display: flex;
  justify-content: center;
  padding: 2.7rem 0;
}
.perfil-panel {
  background: #f5fafd;
  border-radius: 1.5rem;
  box-shadow: 0 8px 32px #17335c15;
  max-width: 450px;
  width: 100%;
  padding: 2rem 2rem 1rem 2rem;
  margin: 1rem;
}

.perfil-title-row {
  display: flex; align-items: center; gap: 0.7em; margin-bottom: 1em;
}
.perfil-logo {
  height: 34px;
  margin-right: .7em;
  filter: drop-shadow(0 2px 0 #22bb5b33);
}

.perfil-form {
  display: flex;
  flex-direction: column;
  gap: 1.2em;
  margin-top: 1.1em;
}
.perfil-field {
  display: flex;
  flex-direction: column;
  gap: .4em;
}
.perfil-form label {
  color: #2368b8;
  font-size: 1.04em;
  font-weight: 500;
}
.perfil-form input[type="text"],
.perfil-form input[type="email"] {
  border-radius: 9px;
  border: 1.2px solid #d6e5f4;
  background: #fff;
  padding: .85em 1em;
  font-size: 1.09em;
  color: #234567;
  margin-bottom: .2em;
  box-shadow: 0 2px 8px #1938660c;
  transition: border .16s;
}
.perfil-form input:focus {
  outline: none;
  border: 1.6px solid #39a1e5;
}
.perfil-actions {
  text-align: right;
}
.btn-green {
  background: #22bb5b;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.7em 1.6em;
  font-weight: bold;
  font-size: 1.08em;
  cursor: pointer;
  transition: background .18s;
}
.btn-green:hover { background: #1b9448; }

.alert { padding: .7em 1em; border-radius: .8em; margin-bottom: .7em; font-size: 1em; }
.alert.success { background: #dafbe6; color: #197745; }
.alert.error { background: #ffe6e6; color: #a72222; border: 1px solid #e36d6d; }

@media (max-width: 650px) {
  .perfil-panel { max-width: 98vw; padding: 1.2rem 0.5rem 1rem 0.5rem;}
}

.admin-confirm-input {
  border: 1.2px solid #f06292;
  border-radius: 8px;
  padding: .45em .9em;
  margin: 0 0 0.5em 0;
  width: 90%;
  background: #fff0f4;
  color: #b01030;
  font-size: 1em;
}
.admin-confirm-label {
  color: #b01030;
  font-size: .92em;
  margin-bottom: .5em;
}
.btn-red {
  background: #ee2741;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5em 1.1em;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  transition: background .15s;
  margin-top: .3em;
}
.btn-red:hover { background: #a11022; }

