/* Custom styles for Recuento Electoral */

/* Bootstrap CSS Variables Override */
:root {
  --bs-primary: #1e40af;
  --bs-primary-rgb: 30, 64, 175;
  --bs-body-bg: #f8fafc;
  --bs-body-color: #1e293b;
  --bs-border-color: #e2e8f0;
  --bs-secondary-bg: #f1f5f9;
  --bs-gray-200: #e2e8f0;
  --bs-gray-300: #cbd5e1;
  
  /* Custom color variables */
  --party-default-color: #666666;
  --filter-link-color: #0066cc;
  --border-light: #dee2e6;
}

/* Ensure footer stays at bottom on short pages */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Modern Header styling */
.header-modern {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #6366f1 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.header-top {
  position: relative;
  z-index: 1;
}

.logo-modern {
  height: 48px;
  width: auto;
  filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.header-title h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-subtitle {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
  letter-spacing: 0.3px;
}

/* Modern Tabs Navigation */
.nav-tabs-modern {
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.15);
  padding: 0;
  position: relative;
  z-index: 1;
}

.nav-tab-modern {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.9rem;
  font-weight: 500;
  background: transparent;
  border-bottom: 3px solid transparent;
  position: relative;
  overflow: hidden;
}

.nav-tab-modern::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.1);
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-tab-modern:hover::before {
  height: 100%;
}

.nav-tab-modern:hover {
  color: white;
  border-bottom-color: rgba(255, 255, 255, 0.4);
}

.nav-tab-modern.active {
  background: white;
  color: #1e3a8a;
  font-weight: 600;
  border-bottom-color: #fbbf24;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.nav-tab-modern.active::before {
  display: none;
}

.nav-tab-modern i {
  font-size: 1.1rem;
  position: relative;
  z-index: 1;
}

.nav-tab-modern span {
  position: relative;
  z-index: 1;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .header-title h1 {
    font-size: 1.1rem;
  }
  
  .header-subtitle {
    font-size: 0.7rem;
  }
  
  .logo-modern {
    height: 40px;
  }
  
  .nav-tab-modern {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    flex: 1;
    justify-content: center;
  }
  
  .nav-tab-modern i {
    font-size: 1rem;
  }
  
  .nav-tab-modern span {
    display: none;
  }
}

/* Party badge styling */
.party-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.party-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

/* Legend styling */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend i {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

/* Tile card styling for mapa.html */
.tile-card {
  border: none;
  color: white;
  transition: transform 0.2s, box-shadow 0.2s;
}

.tile-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tile-card .card-title {
  font-size: 0.95rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.tile-card .card-text {
  margin-bottom: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .tile-card {
    padding: 0.75rem;
  }
}

/* Footer styling */
.footer {
  margin-top: auto;
}

/* Table and filter styling */
.municipio-filter {
  cursor: pointer;
  color: var(--filter-link-color);
  text-decoration: underline;
}

.municipio-filter:hover {
  text-decoration: none;
}

.table-responsive {
  border: 1px solid #d6d6d6;
  border-radius: 10px;
  overflow: hidden;
}
