/* SurfCast.com.br - CSS Principal */

/* Variáveis CSS - Paleta SurfCast */
:root {
  /* Cores principais SurfCast */
  --surfcast-blue: #0066CC;        /* Azul oceânico principal */
  --surfcast-teal: #00A0B0;        /* Verde-azul ondas */
  --surfcast-orange: #FF8C42;      /* Laranja pôr do sol */
  --surfcast-navy: #1B365D;        /* Azul escuro profissional */
  
  /* Cores funcionais */
  --wave-excellent: #28A745;       /* Verde - ondas excelentes */
  --wave-good: #17A2B8;           /* Azul - ondas boas */
  --wave-fair: #FFC107;           /* Amarelo - ondas regulares */
  --wave-poor: #DC3545;           /* Vermelho - ondas ruins */
  
  /* Cores de apoio */
  --sand-beige: #F4F1E8;          /* Bege areia */
  --wind-gray: #6C7B7F;           /* Cinza vento */
  --text-dark: #2C3E50;           /* Texto escuro */
  --bg-light: #F8F9FA;            /* Fundo claro */
  
  /* Tipografia */
  --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-mono: 'Courier New', monospace;
}

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

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--bg-light);
}

/* Tema SurfCast */
.surfcast-theme {
  --primary: var(--surfcast-blue);
  --secondary: var(--surfcast-teal);
  --accent: var(--surfcast-orange);
  --bg-primary: white;
  --bg-secondary: var(--bg-light);
}

/* Header Principal */
.surf-header {
  background: linear-gradient(135deg, var(--surfcast-blue) 0%, var(--surfcast-teal) 100%);
  color: white;
  padding: 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-top {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  width: 40px;
  height: 40px;
}

.site-title {
  font-size: 28px;
  font-weight: bold;
  margin: 0;
}

.tagline {
  font-size: 12px;
  opacity: 0.9;
  font-weight: 300;
}

.location-info h2 {
  font-size: 20px;
  margin: 0;
}

.location-info p {
  font-size: 14px;
  opacity: 0.8;
  margin: 0;
}

/* Seletor de Unidades */
.units-selector {
  position: relative;
}

.units-selector select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  min-width: 200px;
}

.units-selector select:hover {
  background: rgba(255, 255, 255, 0.15);
}

.units-selector select option {
  background: var(--surfcast-blue);
  color: white;
}


/* Hero Section */
.hero-forecast {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: center;
}

.current-surf {
  text-align: center;
}

.surf-height {
  font-size: 48px;
  font-weight: bold;
  color: var(--surfcast-blue);
  margin: 0;
}

.surf-quality {
  margin-top: 10px;
}

.stars {
  font-size: 24px;
  color: var(--surfcast-orange);
}

.rating-text {
  display: block;
  font-size: 16px;
  font-weight: bold;
  color: var(--wind-gray);
  margin-top: 5px;
}

/* Condições Chave */
.key-conditions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}

.condition-item {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.condition-item .label {
  display: block;
  font-size: 12px;
  color: var(--wind-gray);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 8px;
}

.condition-item .value {
  display: block;
  font-size: 18px;
  font-weight: bold;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.condition-item .status {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.status.offshore {
  background: var(--wave-excellent);
  color: white;
}

.status.fair {
  background: var(--wave-fair);
  color: var(--text-dark);
}

/* Seção de Gráfico */
.forecast-chart-section {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.forecast-chart-section h3 {
  margin-bottom: 20px;
  color: var(--surfcast-navy);
}

.chart-container {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  height: 400px;
}

/* Seção de Tabelas de Previsão */
.forecast-tables-section {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.forecast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.forecast-header h3 {
  color: var(--surfcast-navy);
  margin: 0;
  font-size: 24px;
}

.units-display {
  display: flex;
  gap: 15px;
  font-size: 12px;
  color: var(--wind-gray);
}

.unit-label {
  font-weight: 500;
}

/* Container para cada tabela */
.forecast-table-container {
  margin-bottom: 30px;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.forecast-table-container:last-child {
  margin-bottom: 0;
}

.forecast-table-container h4 {
  margin: 0;
  padding: 20px 24px 16px;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 2px solid #dee2e6;
}

/* Cores específicas para cada tabela */
.forecast-table-container:nth-child(2) h4 {
  color: var(--surfcast-blue);
  background: linear-gradient(135deg, rgba(0, 102, 204, 0.1) 0%, rgba(0, 102, 204, 0.05) 100%);
  border-bottom-color: var(--surfcast-blue);
}

.forecast-table-container:nth-child(3) h4 {
  color: var(--surfcast-teal);
  background: linear-gradient(135deg, rgba(0, 160, 176, 0.1) 0%, rgba(0, 160, 176, 0.05) 100%);
  border-bottom-color: var(--surfcast-teal);
}

.forecast-table-container:nth-child(4) h4 {
  color: #7c3aed;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(124, 58, 237, 0.05) 100%);
  border-bottom-color: #7c3aed;
}

/* Tabela de Previsão */
.forecast-table {
  overflow-x: auto;
  background: white;
}

.forecast-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.forecast-table th {
  padding: 16px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Cores dos headers por tabela */
.forecast-table-container:nth-child(2) .forecast-table th {
  background: var(--surfcast-blue);
  color: white;
}

.forecast-table-container:nth-child(3) .forecast-table th {
  background: var(--surfcast-teal);
  color: white;
}

.forecast-table-container:nth-child(4) .forecast-table th {
  background: #7c3aed;
  color: white;
}

.forecast-table th small {
  font-weight: normal;
  opacity: 0.9;
  font-size: 11px;
}

.forecast-table td {
  padding: 14px 12px;
  text-align: center;
  border-bottom: 1px solid #f1f3f4;
  font-size: 13px;
  vertical-align: middle;
}

.forecast-table tbody tr:hover {
  background: rgba(0, 102, 204, 0.04);
  transition: background-color 0.2s ease;
}

.forecast-table tbody tr:nth-child(even) {
  background: rgba(248, 249, 250, 0.5);
}

.forecast-table tbody tr:nth-child(even):hover {
  background: rgba(0, 102, 204, 0.06);
}

/* Estilização de dados específicos */
.forecast-table td:first-child {
  font-weight: 600;
  color: var(--surfcast-navy);
  background: rgba(248, 249, 250, 0.8);
  border-right: 2px solid #e9ecef;
}

.forecast-table td:last-child {
  font-size: 16px;
  font-weight: 500;
}

/* Responsividade das tabelas */
@media (max-width: 768px) {
  .forecast-table-container h4 {
    padding: 16px 20px 12px;
    font-size: 16px;
  }
  
  .forecast-table th,
  .forecast-table td {
    padding: 12px 8px;
    font-size: 12px;
  }
  
  .forecast-table th {
    font-size: 11px;
  }
  
  .forecast-table td:first-child {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .forecast-tables-section {
    padding: 0 15px;
  }
  
  .forecast-table-container {
    margin-bottom: 20px;
    border-radius: 12px;
  }
  
  .forecast-table-container h4 {
    padding: 12px 16px 10px;
    font-size: 15px;
  }
  
  .forecast-table th,
  .forecast-table td {
    padding: 10px 6px;
    font-size: 11px;
  }
  
  .forecast-table th {
    font-size: 10px;
  }
  
  .forecast-table td:last-child {
    font-size: 14px;
  }
}

/* Widget Flutuante de Unidades */
.floating-units-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  font-family: inherit;
}

.widget-toggle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--surfcast-blue);
  color: white;
  border: none;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.widget-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.widget-options {
  position: absolute;
  bottom: 60px;
  right: 0;
  background: white;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  min-width: 140px;
}

.widget-options button {
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background 0.2s;
}

.widget-options button:hover {
  background: var(--sand-beige);
}

.widget-options button.active {
  background: var(--surfcast-blue);
  color: white;
}

.widget-options span {
  display: block;
  font-weight: 500;
  font-size: 14px;
}

.widget-options small {
  display: block;
  opacity: 0.7;
  font-size: 11px;
  margin-top: 2px;
}

/* Tooltips de Unidades */
.unit-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 10px;
  border-radius: 6px;
  font-size: 12px;
  z-index: 1000;
  min-width: 150px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.system-name {
  font-weight: 500;
  color: #ccc;
}

.value {
  font-weight: bold;
  color: var(--surfcast-blue);
}

/* Animações de Transição */
[data-unit] {
  transition: all 0.3s ease;
}

[data-unit].updating {
  opacity: 0.5;
  transform: scale(0.95);
}

/* Footer */
.surf-footer {
  background: var(--surfcast-navy);
  color: white;
  margin-top: 60px;
  padding: 40px 0 20px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
}

.footer-section h4 {
  margin-bottom: 15px;
  color: var(--surfcast-orange);
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-section a {
  color: white;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-section a:hover {
  opacity: 1;
}

.footer-bottom {
  max-width: 1200px;
  margin: 30px auto 0;
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 14px;
  opacity: 0.7;
}

/* Responsividade */
@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .brand-section {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .units-selector select {
    width: 100%;
    font-size: 12px;
    padding: 6px 10px;
  }
  
  
  .hero-forecast {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }
  
  .surf-height {
    font-size: 36px;
  }
  
  .key-conditions {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .forecast-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .units-display {
    flex-wrap: wrap;
  }
  
  .floating-units-widget {
    bottom: 80px; /* Evitar conflito com navegação mobile */
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .key-conditions {
    grid-template-columns: 1fr;
  }
  
  .condition-item {
    padding: 15px;
  }
  
  .chart-container {
    padding: 15px;
    height: 300px;
  }
  
  .forecast-table {
    font-size: 11px;
  }
  
  .forecast-table th,
  .forecast-table td {
    padding: 8px 4px;
  }
}

/* Estados de Loading */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--surfcast-blue);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Notificações */
.unit-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--surfcast-blue);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Indicadores de Qualidade */
.rating-excellent { color: var(--wave-excellent); }
.rating-good { color: var(--wave-good); }
.rating-fair { color: var(--wave-fair); }
.rating-poor { color: var(--wave-poor); }

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print Styles */
@media print {
  .floating-units-widget,
  .surf-footer {
    display: none;
  }
  
  .surf-header {
    background: white;
    color: black;
    box-shadow: none;
  }
  
  .chart-container {
    height: 200px;
  }
}
