/* ==========================================================================
   HOURLY WEATHER TABLE & DETAIL LIGHTBOX MODAL
   Tabella oraria dettagliata a 13 colonne e finestra di approfondimento
   ========================================================================== */

.hourly_forecast_section {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hourly_header_bar {
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.hourly_title_group {
  display: flex;
  flex-direction: column;
}

.table_hint_subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.hourly_controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step_toggle_group {
  display: flex;
  background: #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 2px;
}

.btn_step {
  border: none;
  background: none;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn_step.active {
  background: var(--primary-blue);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Tabella Responsive */
.table_responsive_wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.weather_table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 13px;
  white-space: nowrap;
}

.weather_table thead {
  background: #f1f5f9;
  border-bottom: 2px solid var(--border-medium);
  position: sticky;
  top: 0;
  z-index: 10;
}

.weather_table th {
  padding: 10px 8px;
  font-weight: 700;
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-right: 1px solid rgba(226, 232, 240, 0.6);
}

.weather_table th:last-child {
  border-right: none;
}

.weather_table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  transition: background-color 0.12s ease;
  cursor: pointer;
}

.weather_table tbody tr:hover {
  background-color: #f0f7fb !important;
}

.weather_table tbody tr:nth-child(even) {
  background-color: #fbfcfe;
}

/* Riga dell'ora attuale */
.table_row_hour.row_current_now {
  background-color: #e6f4fa !important;
  border-left: 3px solid var(--primary-blue);
  font-weight: 600;
}

.weather_table td {
  padding: 8px 6px;
  vertical-align: middle;
  border-right: 1px solid rgba(226, 232, 240, 0.4);
}

.weather_table td:last-child {
  border-right: none;
}

/* 1. Colonna Ora */
.col_hour {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  min-width: 60px;
}

.hour_cell {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.now_badge {
  font-size: 9px;
  font-weight: 800;
  color: #ffffff;
  background: var(--primary-blue);
  padding: 1px 4px;
  border-radius: 3px;
  margin-top: 1px;
}

/* 2. Colonna Tempo */
.col_weather {
  min-width: 140px;
  text-align: left !important;
}

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

.table_icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
}

.table_weather_desc {
  font-size: 13px;
  color: #334155;
  text-transform: capitalize;
}

/* 3. Colonna Temperatura */
.col_temp {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  min-width: 55px;
}

/* 4. Colonna Precipitazioni */
.col_precip {
  min-width: 110px;
  font-size: 12px;
}

.precip_none {
  color: #94a3b8;
  font-style: italic;
}

.precip_active {
  color: #0288d1;
  font-weight: 700;
}

.precip_active small {
  color: #0288d1;
  font-weight: 600;
}

/* 5. Colonna Vento */
.col_wind {
  min-width: 130px;
}

.wind_cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

.wind_arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wind_code {
  font-weight: 700;
  color: #0f172a;
}

.wind_speed strong {
  color: #007ab9;
  font-size: 13px;
}

.wind_gust {
  color: #64748b;
  font-size: 11px;
}

/* 6. Colonna Grandine */
.col_hail {
  min-width: 60px;
  font-size: 12px;
  color: #64748b;
}

.hail_alert {
  color: #e11d48;
  font-weight: 800;
}

/* 7. Colonna T. Percepita */
.col_apparent {
  min-width: 65px;
  color: #475569;
}

/* 8. Colonna Pressione */
.col_pressure {
  min-width: 65px;
  color: #475569;
}

/* 9. Colonna Umidità */
.col_humidity {
  min-width: 50px;
  color: #0288d1;
  font-weight: 600;
}

/* 10. Colonna Visibilità */
.col_visibility {
  min-width: 80px;
  line-height: 1.1;
}

.vis_text {
  font-weight: 600;
  color: #334155;
  display: block;
}

.vis_desc {
  font-size: 10px;
  color: #64748b;
}

/* 11. Colonna Qualità Aria */
.col_air {
  min-width: 100px;
}

.air_bullet_wrapper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
}

.air_bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.air_summary {
  color: #475569;
}

/* 12. Colonna UV */
.col_uv {
  min-width: 50px;
  font-weight: 700;
  color: #d97706;
}

/* 13. Colonna Quota 0°C */
.col_freezing {
  min-width: 75px;
  color: #475569;
  font-size: 12px;
}

/* ==========================================================================
   DETAIL LIGHTBOX MODAL DIALOG
   ========================================================================== */
.modal_overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.modal_overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal_dialog_box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 24px;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal_close_btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.modal_close_btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.modal_header_section {
  margin-bottom: 15px;
}

.modal_location_name {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-blue);
  line-height: 1.2;
}

.modal_datetime_info {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.modal_weather_summary {
  display: flex;
  align-items: center;
  gap: 15px;
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 15px;
}

.modal_icon_box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal_weather_text {
  display: flex;
  flex-direction: column;
}

.modal_condition {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  text-transform: capitalize;
}

.modal_temp_preview {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-blue);
}

.modal_divider {
  border: 0;
  border-top: 1px solid var(--border-light);
  margin: 15px 0;
}

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

.modal_data_row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.modal_data_row:last-child {
  border-bottom: none;
}

.data_label {
  color: #64748b;
  font-weight: 500;
}

.data_value {
  color: #0f172a;
  font-weight: 700;
  text-align: right;
}

.qa_inline_badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.text_muted {
  color: #64748b;
  font-weight: 400;
}

.badge_sub {
  font-weight: 400;
  color: #64748b;
  font-size: 12px;
}

/* Mobile Sticky Column Option */
@media (max-width: 768px) {
  .weather_table td, .weather_table th {
    padding: 6px 4px;
    font-size: 12px;
  }

  .col_hour {
    position: sticky;
    left: 0;
    background: #ffffff;
    z-index: 5;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
  }

  .table_row_hour.row_current_now .col_hour {
    background: #e6f4fa !important;
  }

  .weather_table thead th:first-child {
    position: sticky;
    left: 0;
    background: #f1f5f9;
    z-index: 12;
  }
}
