/* ============================================================
   MooHands - Estilos
   Red Social Accesible para Personas Sordas
   Diseño centrado en accesibilidad visual
   ============================================================ */

/* ── Variables ──────────────────────────────────────── */
:root {
  --primary: #6C5CE7;
  --primary-dark: #5A4BD1;
  --primary-light: #A29BFE;
  --secondary: #00CEC9;
  --accent: #FD79A8;
  --success: #00B894;
  --warning: #FDCB6E;
  --danger: #E17055;
  --bg: #F8F9FA;
  --bg-card: #FFFFFF;
  --bg-dark: #2D3436;
  --text: #2D3436;
  --text-secondary: #636E72;
  --text-muted: #B2BEC3;
  --border: #DFE6E9;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.12);
  --radius: 16px;
  --radius-small: 10px;
  --font-size: 16px;
  --nav-height: 64px;
  --transition: 0.2s ease;
}

/* Alto contraste */
body.high-contrast {
  --primary: #FFD700;
  --primary-dark: #FFC107;
  --primary-light: #FFEB3B;
  --bg: #000000;
  --bg-card: #1A1A1A;
  --text: #FFFFFF;
  --text-secondary: #CCCCCC;
  --text-muted: #888888;
  --border: #444444;
}

/* Tamaños de texto */
body.text-small { --font-size: 14px; }
body.text-medium { --font-size: 16px; }
body.text-large { --font-size: 20px; }
body.text-xlarge { --font-size: 24px; }

/* ── Reset & Base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--font-size);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ── Visual Alert (Flash para personas sordas) ───── */
.visual-alert {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  animation: flash-alert 0.6s ease;
}

@keyframes flash-alert {
  0%, 100% { background: transparent; }
  15% { background: rgba(108, 92, 231, 0.3); }
  30% { background: transparent; }
  45% { background: rgba(108, 92, 231, 0.2); }
  60% { background: transparent; }
  75% { background: rgba(108, 92, 231, 0.1); }
}

body.high-contrast .visual-alert {
  animation-name: flash-alert-hc;
}

@keyframes flash-alert-hc {
  0%, 100% { background: transparent; }
  15% { background: rgba(255, 215, 0, 0.4); }
  30% { background: transparent; }
  45% { background: rgba(255, 215, 0, 0.3); }
}

/* ── Navbar ────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.3em;
  color: var(--primary);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon { font-size: 1.4em; }

.nav-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.nav-search input {
  width: 100%;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: 24px;
  background: var(--bg);
  font-size: 0.9em;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}

.nav-search input:focus {
  border-color: var(--primary);
}

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow-hover);
  max-height: 300px;
  overflow-y: auto;
  margin-top: 4px;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition);
}

.search-item:hover { background: var(--bg); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.nav-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.nav-btn:hover {
  background: var(--bg);
  color: var(--primary);
}

.badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.nav-auth-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-logout-btn:hover {
  color: var(--danger) !important;
}

.avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-light);
}

.avatar-medium {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-light);
}

.avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-light);
}

/* ── Pages ─────────────────────────────────────────── */
.page {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

.content-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

.content-narrow {
  max-width: 700px;
}

/* ── Auth Pages ────────────────────────────────────── */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo {
  font-size: 4em;
  display: block;
  margin-bottom: 8px;
}

.auth-brand h1 {
  font-size: 2.5em;
  font-weight: 800;
  color: var(--primary);
}

.auth-tagline {
  color: var(--text-secondary);
  font-size: 1.1em;
  margin-top: 8px;
}

.auth-lang-picker {
  margin-top: 16px;
}

.auth-lang-picker select {
  padding: 6px 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 0.9em;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
}

.auth-lang-picker select option {
  background: var(--bg-card);
  color: var(--text);
}

.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin-bottom: 24px;
  font-size: 1.4em;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  color: var(--text-secondary);
}

/* ── Forms ─────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9em;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-small);
  font-size: 1em;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-small);
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

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

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

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

.btn-full { width: 100%; }
.btn-small { padding: 6px 14px; font-size: 0.85em; }

/* ── Feed Layout ───────────────────────────────────── */
.feed-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

.feed-main { min-width: 0; }
.feed-sidebar { position: sticky; top: calc(var(--nav-height) + 24px); align-self: start; }

/* ── Post Composer ─────────────────────────────────── */
.post-composer {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.composer-header {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.composer-input {
  flex: 1;
  min-height: 60px;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-small);
  outline: none;
  font-size: 1em;
  line-height: 1.5;
  color: var(--text);
  transition: border-color var(--transition);
}

.composer-input:focus { border-color: var(--primary); }

.composer-input:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.composer-media { display: flex; gap: 8px; }

.media-btn {
  padding: 8px 14px;
  border-radius: var(--radius-small);
  cursor: pointer;
  font-size: 0.9em;
  color: var(--text-secondary);
  transition: all var(--transition);
  background: var(--bg);
}
.media-btn:hover { color: var(--primary); background: rgba(108,92,231,0.08); }
.media-btn input[type=file] { display: none; }

.composer-options { display: flex; gap: 8px; align-items: center; }

.composer-options select {
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--bg);
  font-size: 0.85em;
  color: var(--text);
}

.media-preview {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.media-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
}

.media-preview-item img,
.media-preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-preview-item .remove-media {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── News ───────────────────────────────────────────── */
.auth-news-section {
  width: 100%;
  max-width: 720px;
  margin-top: 32px;
}

.auth-news-section h3 {
  color: white;
  font-size: 1.2em;
  margin-bottom: 16px;
  text-align: center;
}

.news-page-header {
  margin-bottom: 20px;
}

.news-page-header h2 {
  font-size: 1.4em;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.news-card {
  display: block;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: box-shadow var(--transition), transform var(--transition);
}

.news-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.news-source {
  display: inline-block;
  font-size: 0.75em;
  font-weight: 600;
  color: var(--primary);
  background: rgba(108, 92, 231, 0.1);
  padding: 2px 8px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.news-card-title {
  font-size: 1em;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
}

.news-card-summary {
  font-size: 0.85em;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
}

.news-card-date {
  font-size: 0.75em;
  color: var(--text-muted, #999);
}

/* ── Posts ──────────────────────────────────────────── */
.post-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  transition: box-shadow var(--transition);
}

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

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.post-author-info { flex: 1; }

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

.post-meta {
  font-size: 0.8em;
  color: var(--text-muted);
}

.post-sign-badge {
  display: inline-block;
  background: rgba(108,92,231,0.1);
  color: var(--primary);
  font-size: 0.75em;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.post-text {
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.6;
}

.post-media {
  margin-bottom: 12px;
  border-radius: var(--radius-small);
  overflow: hidden;
}

.post-media img {
  width: 100%;
  border-radius: var(--radius-small);
}

.post-media video {
  width: 100%;
  border-radius: var(--radius-small);
  background: #000;
}

.post-transcription {
  background: var(--bg);
  border-left: 3px solid var(--primary);
  padding: 10px 14px;
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
  margin-bottom: 12px;
  font-style: italic;
  font-size: 0.9em;
  color: var(--text-secondary);
}

.post-transcription::before {
  content: '📝 Transcripción: ';
  font-style: normal;
  font-weight: 600;
}

.post-actions {
  display: flex;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.post-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: var(--radius-small);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.9em;
  font-weight: 500;
  transition: all var(--transition);
}

.post-action-btn:hover { background: var(--bg); color: var(--primary); }
.post-action-btn.liked { color: var(--accent); }

/* Reaction types (sign-based) */
.reaction-picker {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--bg-card);
  border-radius: 24px;
  box-shadow: var(--shadow-hover);
}

.reaction-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2em;
  transition: transform var(--transition);
}
.reaction-btn:hover { transform: scale(1.3); }

/* ── Sidebar ───────────────────────────────────────── */
.sidebar-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.sidebar-card h3 {
  font-size: 1em;
  margin-bottom: 14px;
  color: var(--text-secondary);
}

/* Accessibility options */
.accessibility-options { display: flex; flex-direction: column; gap: 14px; }

.switch-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.switch-label input { display: none; }

.switch {
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  transition: background var(--transition);
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}

.switch-label input:checked + .switch {
  background: var(--primary);
}

.switch-label input:checked + .switch::after {
  transform: translateX(20px);
}

.text-size-options span { display: block; margin-bottom: 8px; }

.size-buttons {
  display: flex;
  gap: 6px;
}

.size-buttons button {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.size-buttons button:nth-child(1) { font-size: 12px; }
.size-buttons button:nth-child(2) { font-size: 14px; }
.size-buttons button:nth-child(3) { font-size: 18px; }
.size-buttons button:nth-child(4) { font-size: 22px; }

.size-buttons button.active,
.size-buttons button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(108,92,231,0.05);
}

.lang-selector {
  margin-top: 12px;
}

.lang-selector span {
  display: block;
  margin-bottom: 8px;
}

.lang-selector select {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9em;
  cursor: pointer;
  transition: border-color var(--transition);
}

.lang-selector select:focus {
  border-color: var(--primary);
  outline: none;
}

.online-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.online-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background var(--transition);
}

.online-item:hover { background: var(--bg); }

.online-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

/* ── Messages ──────────────────────────────────────── */
.messages-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  height: calc(100vh - var(--nav-height) - 48px);
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.conversations-list {
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.conversations-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.conversations-header h2 { font-size: 1.1em; }

.conv-list { overflow-y: auto; }

.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.conv-item:hover, .conv-item.active { background: var(--bg); }

.conv-info { flex: 1; min-width: 0; }

.conv-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.conv-last {
  font-size: 0.85em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.conv-time { font-size: 0.75em; color: var(--text-muted); }

.conv-unread {
  min-width: 20px;
  height: 20px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.chat-area {
  display: flex;
  flex-direction: column;
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.chat-empty-icon { font-size: 3em; margin-bottom: 16px; }

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-bubble {
  max-width: 70%;
  padding: 10px 16px;
  border-radius: 18px;
}

.message-bubble.sent {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 6px;
}

.message-bubble.received {
  align-self: flex-start;
  background: var(--bg);
  color: var(--text);
  border-bottom-left-radius: 6px;
}

.message-bubble video {
  max-width: 300px;
  border-radius: 12px;
}

.message-sender {
  font-size: 0.75em;
  font-weight: 600;
  margin-bottom: 4px;
  opacity: 0.8;
}

.message-time {
  font-size: 0.7em;
  opacity: 0.6;
  margin-top: 4px;
  text-align: right;
}

.chat-typing {
  padding: 8px 20px;
  font-size: 0.85em;
  color: var(--text-muted);
  font-style: italic;
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  align-items: flex-end;
}

.chat-input-area input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 24px;
  font-size: 1em;
  color: var(--text);
  outline: none;
  background: var(--bg);
}

.chat-input-area input:focus { border-color: var(--primary); }

/* ── Groups ────────────────────────────────────────── */
.groups-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.groups-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 24px;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.9em;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.filter-btn:hover, .filter-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(108,92,231,0.05);
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.group-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  cursor: pointer;
}

.group-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.group-cover {
  height: 100px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  position: relative;
}

.group-body { padding: 16px; }

.group-name { font-weight: 700; font-size: 1.05em; margin-bottom: 4px; }

.group-info {
  font-size: 0.85em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.group-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.group-tag {
  font-size: 0.75em;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--bg);
  color: var(--text-secondary);
}

/* ── Notifications ─────────────────────────────────── */
.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.notif-list { display: flex; flex-direction: column; gap: 4px; }

.notif-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-small);
  cursor: pointer;
  transition: all var(--transition);
}

.notif-item:hover { box-shadow: var(--shadow); }
.notif-item.unread { border-left: 3px solid var(--primary); background: rgba(108,92,231,0.03); }

.notif-icon { font-size: 1.5em; flex-shrink: 0; }

.notif-content { flex: 1; }
.notif-text { font-size: 0.95em; }
.notif-time { font-size: 0.8em; color: var(--text-muted); margin-top: 2px; }

/* ── Profile ───────────────────────────────────────── */
.profile-header {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.profile-cover {
  height: 200px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.profile-info {
  padding: 0 24px 24px;
  margin-top: -40px;
}

.profile-info .avatar-large {
  border: 4px solid var(--bg-card);
}

.avatar-wrapper {
  position: relative;
  display: inline-block;
}

.avatar-editable {
  cursor: pointer;
}

.avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  cursor: pointer;
}

.avatar-editable:hover .avatar-overlay {
  opacity: 1;
}

.avatar-overlay-icon {
  font-size: 1.6em;
  filter: grayscale(1) brightness(2);
}

.profile-name { font-size: 1.5em; font-weight: 800; margin-top: 12px; }

.profile-username { color: var(--text-muted); margin-bottom: 8px; }

.profile-bio { color: var(--text-secondary); margin-bottom: 12px; }

.profile-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
}

.profile-stat { text-align: center; }
.profile-stat-num { font-weight: 800; font-size: 1.2em; color: var(--primary); }
.profile-stat-label { font-size: 0.85em; color: var(--text-muted); }

.profile-sign-lang {
  display: inline-block;
  background: rgba(108,92,231,0.1);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.9em;
}

/* ── Toasts ────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow-hover);
  border-left: 4px solid var(--primary);
  animation: toast-in 0.3s ease;
  max-width: 380px;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-icon { font-size: 1.3em; flex-shrink: 0; }
.toast-text { font-size: 0.9em; }

/* ── Loading ───────────────────────────────────────── */
.loading-spinner {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.load-more {
  text-align: center;
  padding: 20px;
}

.text-muted { color: var(--text-muted); }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 900px) {
  .feed-layout {
    grid-template-columns: 1fr;
  }
  .feed-sidebar { display: none; }

  .messages-layout {
    grid-template-columns: 1fr;
  }
  .conversations-list.hide-mobile { display: none; }
  .chat-area.show-mobile { display: flex; }

  .nav-search { display: none; }
  .brand-text { display: none; }
}

@media (max-width: 600px) {
  .content-container { padding: 12px; }
  .post-composer { padding: 14px; }
  .composer-media { flex-wrap: wrap; }

  .groups-grid {
    grid-template-columns: 1fr;
  }

  .auth-card { padding: 20px; }
  .auth-logo { font-size: 3em; }
  .auth-brand h1 { font-size: 2em; }
}

/* ── Focus visible (accesibilidad teclado) ─────────── */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* ── Animations (reducción de movimiento) ──────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
