/* Rava.com — CSS critico */

/* Fonts */
@font-face {
  font-family: 'Lato';
  src: url('../fonts/Lato-Regular.woff2') format('woff2'),
       url('../fonts/Lato-Regular.woff') format('woff');
  font-style: normal;
  font-weight: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('../fonts/Nunito-Regular.woff2') format('woff2'),
       url('../fonts/Nunito-Regular.woff') format('woff');
  font-style: normal;
  font-weight: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Armata';
  src: url('../fonts/Armata-Regular.woff2') format('woff2'),
       url('../fonts/Armata-Regular.woff') format('woff');
  font-style: normal;
  font-weight: normal;
  font-display: swap;
}

/* Variables */
:root {
  --rava-blue-01: rgba(29, 104, 167, 0.1);
  --rava-blue-02: rgba(29, 104, 167, 0.2);
  --rava-blue-03: rgba(29, 104, 167, 0.3);
  --rava-blue-07: rgba(29, 104, 167, 0.7);
  --rava-blue-light: #1d68a7;
  --rava-blue-medium: #004b6f;
  --rava-blue-strong: #003046;
  --rava-gold-01: rgba(224, 168, 48, 0.1);
  --rava-gold-medium: #e0a830;
  --rava-gold-strong: #c49229;
  --color-success: #008800;
  --color-danger: #e3342f;
  --text-muted: #999;
  --lightgray: #ccc;
  --dark-mode: #1a1a2e;
  --dark-mode-gold: #f0c040;
  --dark-mode-red: #ff6b6b;
  --dark-mode-green: #51cf66;
}

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

body {
  font-family: 'Nunito', 'Lato', Arial, sans-serif;
  color: #333;
  background: #f5f5f5;
  line-height: 1.4;
  font-size: 14px;
}

a { color: var(--rava-blue-medium); text-decoration: none; }
a:hover { color: var(--rava-blue-light); }

/* Navbar */
.navbar {
  background: var(--rava-blue-strong);
  color: white;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}

.navbar__logo { height: 36px; display: flex; align-items: center; }
.navbar__logo img { height: 100%; }

.navbar__links {
  display: none;
  list-style: none;
  gap: 4px;
  align-items: center;
}

.navbar__links > li { position: relative; }

.navbar__links a {
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s;
}

.navbar__links a:hover { background: rgba(255,255,255,0.1); color: white; }

/* Navbar dropdowns */
.navbar__dropdown { position: relative; }

.navbar__dropdown-trigger {
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s;
  cursor: pointer;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar__dropdown-trigger:hover { background: rgba(255,255,255,0.1); }

.navbar__caret {
  font-size: 10px;
  transition: transform 0.2s;
}

.navbar__dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--rava-blue-strong);
  min-width: 200px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 1001;
  padding: 4px 0;
  list-style: none;
}

.navbar__dropdown:hover .navbar__dropdown-menu,
.navbar__dropdown-menu.open { display: block; }

.navbar__dropdown-menu a {
  display: block;
  color: white;
  padding: 8px 16px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.navbar__dropdown-menu a:hover { background: rgba(255,255,255,0.1); color: white; }

/* Navbar actions (buttons + icons) */
.navbar__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.navbar__btn {
  color: white;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.navbar__btn--primary { background: var(--rava-blue-light); }
.navbar__btn--primary:hover { background: var(--rava-blue-07); color: white; }
.navbar__btn--secondary { background: var(--rava-gold-medium); color: var(--rava-blue-strong) !important; }
.navbar__btn--secondary:hover { background: var(--rava-gold-strong); color: var(--rava-blue-strong) !important; }

.navbar__btn-icon {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar__btn-icon .material-icons { font-size: 24px; }
.navbar__btn-icon:hover { color: rgba(255,255,255,0.7); }

/* Hamburger — mobile only */
.navbar__hamburger {
  display: flex;
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 4px;
  align-items: center;
}

/* Legacy class support */
.navbar-logo { height: 36px; }
.navbar-logo img { height: 100%; }
.btn-ingresa { background: var(--rava-blue-light); }
.btn-ingresa:hover { background: var(--rava-blue-07); }
.btn-cuenta { background: var(--rava-gold-medium); color: var(--rava-blue-strong) !important; }
.btn-cuenta:hover { background: var(--rava-gold-strong); }
.menu-toggle {
  display: flex;
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 56px;
  left: -280px;
  width: 280px;
  height: calc(100vh - 56px);
  background: white;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  z-index: 999;
  overflow-y: auto;
  transition: left 0.3s;
}

.sidebar.open,
.sidebar--open { left: 0; }

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 998;
}

.sidebar-overlay.open { display: block; }

.sidebar__header {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar__body {
  overflow-y: auto;
  flex: 1;
}

.sidebar__footer {
  padding: 12px 16px;
  border-top: 1px solid #eee;
}

.sidebar__section { border-bottom: 1px solid #eee; }
.sidebar-section { border-bottom: 1px solid #eee; }

.sidebar__section-title,
.sidebar-title {
  padding: 12px 16px;
  font-weight: bold;
  color: var(--rava-blue-medium);
  font-size: 13px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.sidebar__caret {
  font-size: 12px;
  transition: transform 0.2s;
  margin-left: auto;
}

.sidebar__caret--open { transform: rotate(180deg); }

.sidebar__section-links,
.sidebar-links {
  list-style: none;
  display: none;
  padding-bottom: 8px;
}

.sidebar__section-links.open,
.sidebar-links.open { display: block; }

.sidebar__section-links a,
.sidebar-links a {
  display: block;
  padding: 6px 16px 6px 44px;
  color: #555;
  font-size: 13px;
}

.sidebar__section-links a:hover,
.sidebar-links a:hover { background: var(--rava-blue-01); color: var(--rava-blue-medium); }

.sidebar__btn {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: center;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

/* Responsive utilities */
@media (min-width: 992px) {
  .hide-on-large-only { display: none !important; }
}
@media (max-width: 991px) {
  .hide-on-med-and-down { display: none !important; }
}

/* Layout */
.container_ {
  margin: 25px auto 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  padding: 0 10px;
}

.lateral, .centro { width: 100%; }

/* Cards & Tables */
.card {
  background: white;
  border: 1px solid rgba(0,0,0,0.03);
  border-radius: 4px;
  margin-bottom: 20px;
  overflow: hidden;
}

.rava-box-shadow { box-shadow: 0 5px 20px rgba(0,0,0,0.1); }

.card-content { padding: 0; }

/* Card header */
.card__header {
  background: var(--rava-blue-strong);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card__header .card__title {
  color: white;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
  font-weight: bold;
}
.card__header .card__link {
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 2px;
}
.card__header .card__link:hover { color: white; }
.card__header .card__link .material-icons { font-size: 14px; }

/* Lo mejor / Lo peor card variants */
.card--mejor .card__header { background: var(--color-success); }
.card--mejor .card__header .card__title { color: white; }
.card--peor .card__header { background: var(--color-danger); }
.card--peor .card__header .card__title { color: white; }

table { width: 100%; border-collapse: collapse; }

table th, table td {
  padding: 2px 3px;
  font-size: 13px;
  border: none;
}

.tr-sector-title {
  background: var(--rava-blue-strong);
  text-transform: uppercase;
  color: white;
  border-bottom: none;
}

.th-sector-title {
  text-align: center;
  padding: 8px !important;
  font-size: 14px;
}

.th-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.tr-title {
  background: var(--rava-blue-01);
  color: black;
}

.tr-title th {
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 5px 3px !important;
}

tbody tr:nth-child(even) { background: rgba(0,0,0,0.03); }
tbody tr:hover { background: var(--rava-blue-01); }

td:first-child, th:first-child { text-align: left; }
td:not(:first-child), th:not(:first-child):not(.th-sector-title) { text-align: right; }

.td-especie a { color: var(--rava-blue-strong); font-weight: bold; }

.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }

.sin-datos { text-align: center; padding: 20px !important; color: var(--text-muted); }

/* Tabs */
.tabs-header {
  display: flex;
  border-bottom: 3px solid transparent;
}

.tab-btn {
  padding: 8px 10px;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--rava-blue-medium);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: bold;
  letter-spacing: 0.5px;
  transition: border-color 0.2s;
}

.tab-btn:hover, .tab-btn.active {
  border-color: var(--rava-blue-medium);
}

.tab-btn.htmx-request {
  opacity: 0.5;
}

/* More link */
.more { color: var(--text-muted); }
.more .material-icons { font-size: 20px; }

/* Market map cards */
.mapa-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 20px;
}
.mapa-card {
  padding: 8px 10px;
  color: white;
  font-weight: bold;
  text-align: center;
  border-radius: 2px;
  min-width: 80px;
  flex: 1;
}
.mapa-card__especie { font-size: 13px; }
.mapa-card__var { font-size: 11px; }
.mapa-card--up { background: var(--color-success); }
.mapa-card--down { background: var(--color-danger); }
.mapa-card--neutral { background: #666; }

/* Banner redes */
.banner-redes {
  background: var(--color-success);
  color: white;
  text-align: center;
  padding: 12px;
  margin-bottom: 20px;
  border-radius: 4px;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
}
.banner-redes a { color: white; margin: 0 6px; }
.banner-redes img { width: 24px; height: 24px; vertical-align: middle; }

/* Noticias */
.noticia-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid #eee;
}
.noticia-item:last-child { border-bottom: none; }
.noticia-img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.noticia-content h4 { font-size: 14px; margin-bottom: 4px; color: var(--rava-blue-strong); }
.noticia-content p { font-size: 12px; color: #666; line-height: 1.4; margin-bottom: 4px; }
.noticia-fecha, .noticia-fuente { font-size: 11px; color: var(--text-muted); }
.noticia-autor { font-size: 11px; color: var(--rava-blue-medium); font-weight: bold; }
.noticia-autor img { width: 30px; height: 30px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }

/* Comentario card */
.comentario-card .card__body { padding: 12px; }
.comentario-card .card__title { font-size: 15px; color: var(--rava-blue-strong); margin-bottom: 8px; text-transform: none; }
.comentario-texto { font-size: 13px; line-height: 1.6; color: #444; }
.comentario-texto p { margin-bottom: 8px; }
.comentario-fecha { font-size: 11px; color: var(--text-muted); display: block; margin-top: 8px; }
.comentario-autor { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.comentario-autor img { width: 40px; height: 40px; border-radius: 50%; }
.comentario-autor span { font-size: 13px; font-weight: bold; color: var(--rava-blue-medium); }

/* Embeds (YouTube shorts, Spotify) */
.embed-card { margin-bottom: 20px; }
.embed-card iframe { width: 100%; border: none; border-radius: 4px; }
.embed-card--youtube iframe { aspect-ratio: 9/16; height: 400px; }
.embed-card--spotify iframe { height: 160px; }

/* Foro */
.foro-item { padding: 6px 10px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.foro-item:last-child { border-bottom: none; }
.foro-item a { font-size: 12px; color: var(--rava-blue-medium); font-weight: bold; }
.foro-item span { font-size: 11px; color: var(--text-muted); }

/* Footer */
.footer {
  border-top: 2px solid var(--rava-blue-01);
  padding: 30px 16px;
  background: transparent;
}

.footer-content {
  max-width: 1350px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 30px;
}

.footer-section { min-width: 200px; }
.footer-section-title {
  font-weight: bold;
  color: var(--rava-blue-medium);
  font-size: 13px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.footer-section ul { list-style: none; }
.footer-section li { margin-bottom: 4px; }
.footer-section a { color: #666; font-size: 12px; }
.footer-section a:hover { color: var(--rava-blue-medium); }

.socios-wrapper {
  text-align: center;
  margin-top: 30px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

div.socio {
  width: 144px;
  height: 107px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.socio-img { height: 40px; }

.socio p {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-family: 'Nunito', sans-serif;
  margin-top: 5px;
}

.social-wrapper {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 16px 0;
}

.social-wrapper img { width: 28px; height: 28px; }

.footer-info {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 20px;
  line-height: 1.6;
}

/* Utility */
.no-padding { padding: 0 !important; }
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* Carousel */
.carousel-container {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 20px;
}

.carousel-container img {
  width: 100%;
  height: auto;
  display: block;
}

/* Static pages */
.static-page {
  max-width: 900px;
  margin: 30px auto;
  background: white;
  padding: 30px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.static-page h1 { color: var(--rava-blue-strong); margin-bottom: 20px; font-size: 24px; }
.static-page h2 { color: var(--rava-blue-medium); margin: 24px 0 12px; font-size: 18px; }
.static-page h3 { color: var(--rava-blue-medium); margin: 16px 0 8px; font-size: 16px; }
.static-page p { margin-bottom: 12px; line-height: 1.7; }
.static-page ul, .static-page ol { margin: 12px 0 12px 24px; }
.static-page li { margin-bottom: 6px; line-height: 1.6; }

/* Responsive */
@media (min-width: 768px) {
  .menu-toggle, .navbar__hamburger { display: none; }
  .navbar-links, .navbar__links { display: flex; }

  .lateral { width: 32%; }
  .centro { width: 36%; padding: 0 10px; }

  table th:not(.th-sector-title), .tab-btn { font-size: 8px; }
  table td { font-size: 10px; }
}

@media (min-width: 992px) {
  .container_ { width: 960px; padding: 0; }
  .lateral { width: 27%; }
  .centro { width: 46%; padding: 0 10px; }
  table td { font-size: 12px; }
}

@media (min-width: 1200px) {
  .container_ { width: 1180px; }
  .tab-btn, table th:not(.th-sector-title) { font-size: 10px; }
  table td { font-size: 14px; }
  .th-sector-title { font-size: 15px; }
}

@media (min-width: 1400px) {
  .container_ { width: 1350px; }
  table td { font-size: 15px; }
  .tab-btn, table th:not(.th-sector-title) { font-size: 12px; }
}

/* Dark mode */
.dark body, .dark { background: #0f0f23; color: var(--lightgray); }
.dark .card { background: var(--dark-mode); color: var(--lightgray); border-color: rgba(255,255,255,0.05); }
.dark .rava-box-shadow { box-shadow: 0 5px 20px rgba(0,0,0,0.3); }
.dark .tr-sector-title { color: white; background: #0a0a1a; border-color: transparent; }
.dark .tr-title { background: rgba(255,255,255,0.05); color: var(--lightgray); }
.dark tbody tr:nth-child(even) { background: rgba(255,255,255,0.03); }
.dark tbody tr:hover { background: var(--rava-blue-02); }
.dark .td-especie a { color: var(--lightgray); }
.dark .td-especie a:hover { color: var(--dark-mode-gold); }
.dark .text-danger { color: var(--dark-mode-red) !important; }
.dark .text-success { color: var(--dark-mode-green) !important; }
.dark .tab-btn { color: var(--dark-mode-gold); }
.dark .tab-btn.active { border-color: var(--dark-mode-gold); }
.dark .navbar { background: #0a0a1a; }
.dark .footer { border-color: rgba(255,255,255,0.05); }
.dark .static-page { background: var(--dark-mode); }
.dark a { color: var(--rava-blue-light); }
.dark .card__header { background: #0a0a1a; }
.dark .card--mejor .card__header { background: #006600; }
.dark .card--peor .card__header { background: #8b0000; }
.dark .mapa-card--up { background: #006600; }
.dark .mapa-card--down { background: #8b0000; }
.dark .banner-redes { background: #006600; }
.dark .noticia-item { border-color: rgba(255,255,255,0.05); }
.dark .foro-item { border-color: rgba(255,255,255,0.05); }
.dark .comentario-texto { color: var(--lightgray); }

/* HTMX loading indicator */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-request.htmx-indicator { display: inline-block; }
