/* Reset & Base */
:root {
  --ion-color-primary: #2d3657;
  --ion-color-secondary: #dd7d36;
  --ion-color-tertiary: #5260ff;
  --ion-color-success: #2dd36f;
  --ion-color-warning: #ffc409;
  --ion-color-danger: #eb445a;
  --ion-color-medium: #92949c;
  --ion-color-light: #f4f5f8;
  --ion-background-color: #f4f5f8;
}

body {
  font-family: 'Inter', sans-serif;
}

/* Container Principal */
.container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 80px;
}

/* Header Title Customization */
ion-title {
  padding-inline: 8px;
}
ion-title div {
  white-space: normal;
  text-overflow: clip;
  overflow: visible;
}

/* PWA Bottom Banner (Fixed) */
.pwa-bottom-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ion-color-primary); /* Blue background */
  color: white;
  padding: 12px 16px;
  z-index: 9999;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
  display: flex;
  justify-content: center;
  animation: slideUp 0.3s ease-out;
}

.pwa-content {
  max-width: 1280px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pwa-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
}

.pwa-text strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.pwa-text p {
  margin: 0;
  color: #ddd;
}

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

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Status Card */
.status-card {
  margin: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  border-radius: 16px;
}

.status-subtitle {
  margin-top: 4px;
  font-weight: normal;
  opacity: 0.9;
  font-size: 0.9rem;
  color: inherit;
}

/* Score de Voo */
.score-container {
  margin: 16px;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.score-icon-wrapper {
  margin-right: 8px;
  display: flex;
  align-items: center;
}

.score-icon-wrapper.success { color: var(--ion-color-success); }
.score-icon-wrapper.danger { color: var(--ion-color-danger); }
.score-icon-wrapper.medium { color: var(--ion-color-medium); }
.score-icon-wrapper.primary { color: var(--ion-color-primary); }

.score-icon-wrapper svg {
  fill: currentColor;
}

.score-label {
  flex: 1;
  font-weight: 600;
  color: var(--ion-color-dark);
  font-size: 1rem;
}

.score-value {
  font-weight: bold;
  font-size: 1.2rem;
}

.score-value.success { color: var(--ion-color-success); }
.score-value.warning { color: var(--ion-color-warning); }
.score-value.danger { color: var(--ion-color-danger); }
.score-value.medium { color: var(--ion-color-medium); }
.score-value.primary { color: var(--ion-color-primary); }

ion-progress-bar {
  height: 12px;
  border-radius: 6px;
  --background: rgba(0,0,0,0.05);
}

/* Compass / Biruta */
.compass-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  position: relative;
}

.compass {
  position: relative;
  width: 250px;
  height: 250px;
  border: 4px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ddd;
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  margin-bottom: 10px;
}

.compass::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.1);
}

.direction-label {
  margin-top: 4px;
  font-weight: bold;
  background: #fff;
  padding: 4px 12px;
  border-radius: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  color: var(--ion-color-dark);
  font-size: 0.9rem;
  z-index: 10;
}

.cardinal {
  position: absolute;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  font-size: 1.1rem;
  z-index: 10;
}

.cardinal.n { top: 10px; }
.cardinal.s { bottom: 10px; }
.cardinal.e { right: 10px; }
.cardinal.w { left: 10px; }

.wind-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: transform 1s ease-out;
  z-index: 20;
}

.wind-icon-part {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) rotate(90deg);
  width: 40px;
  height: 24px;
  z-index: 22;
}

.wind-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.wind-svg path {
  stroke: #fff;
  stroke-width: 8px;
  stroke-linecap: round;
  fill: none;
}

.windsock-part {
  position: absolute; 
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  margin-left: -50px;
  margin-top: -50px;
  z-index: 21; 
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.4));
  pointer-events: none;
}

.windsock-icon {
  width: 100%;
  height: 100%;
}

/* Main Cards */
.main-card {
  margin: 4px;
  height: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.main-card ion-card-header {
  padding: 10px;
}

.main-card ion-card-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.main-card ion-card-title {
  font-size: 1.4rem;
  font-weight: bold;
}

.main-card ion-card-title.small-text {
  font-size: 1rem;
  line-height: 1.2;
}

.main-card ion-card-title small {
  font-size: 0.6em;
  color: var(--ion-color-medium);
}

.main-card ion-card-title .wind-desc {
  display: block;
  font-size: 0.5em;
  color: var(--ion-color-medium);
  font-weight: normal;
  margin-top: -2px;
}

.main-card ion-card-content {
  padding-top: 0;
  padding-bottom: 10px;
}

/* Window Card (Janela de Voo) */
.window-card {
  margin: 16px;
  background: var(--ion-color-light);
  border-left: 5px solid var(--ion-color-success);
}

.window-item {
  --background: transparent;
  --padding-start: 0;
}

.window-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
  padding-left: 16px;
}

.window-card h2 {
  font-size: 0.9rem;
  color: var(--ion-color-medium);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.window-time {
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: 4px;
}

/* Hourly Section */
.hourly-section-title {
  font-size: 1.1rem;
  font-weight: bold;
  margin: 16px 16px 8px;
  color: var(--ion-color-dark);
}

.hourly-scroll {
  display: flex;
  overflow-x: auto;
  padding: 0 16px 16px;
  gap: 12px;
  scrollbar-width: none;
}

.hourly-scroll::-webkit-scrollbar { 
  display: none; 
}

.hourly-item {
  flex: 0 0 auto;
  width: 95px;
  background: #fff;
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Responsividade para telas maiores (Hourly) */
@media (min-width: 768px) {
  .hourly-scroll {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
  }
}

.h-time {
  font-weight: bold;
  color: var(--ion-color-dark);
  font-size: 1rem;
  margin-bottom: 4px;
}

.h-wind, .h-rain, .h-cloud {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--ion-color-medium);
}

.h-wind ion-icon, .h-rain ion-icon, .h-cloud ion-icon {
  font-size: 1.1rem;
}

.h-speed {
  font-weight: 600;
  color: var(--ion-color-dark);
}

/* Summary Row */
.summary-row {
  margin-top: 10px;
  padding: 0 8px;
}

.summary-item {
  background: #fff;
  border-radius: 12px;
  padding: 12px 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.summary-icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.summary-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--ion-color-medium);
  font-weight: 600;
}

.summary-value {
  font-weight: bold;
  color: var(--ion-color-dark);
  font-size: 0.95rem;
}

/* Thermal Card */
.thermal-card {
  margin: 16px;
}

.thermal-item {
  --padding-start: 0;
  --inner-padding-end: 16px;
}

.thermal-card h2 {
  font-weight: bold;
  font-size: 1.1rem;
}

.thermal-status {
  font-weight: 600;
  margin-top: 4px;
}

.thermal-value {
  text-align: right;
  font-size: 1.4rem;
  font-weight: bold;
  line-height: 1.2;
  padding-top: 4px;
}

.thermal-value small {
  display: block;
  font-size: 0.7rem;
  color: var(--ion-color-medium);
  font-weight: normal;
  margin-bottom: 2px;
}

/* Ceiling Card (if exists) */
.ceiling-card {
  margin: 16px;
}

/* Previsão Diária (Next Days List) */
.next-days-list {
  background: transparent;
}

.next-days-list ion-item {
  --padding-start: 16px;
  --inner-padding-end: 16px;
  --background: transparent;
  margin-bottom: 8px;
  border-radius: 8px;
}

.day-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 50px;
  margin-right: 12px;
}

.day-name {
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--ion-color-medium);
  margin-top: 4px;
}

.day-temp {
  font-size: 1.1rem;
  font-weight: bold;
}

.day-temp .max { color: var(--ion-color-dark); }
.day-temp .min { color: var(--ion-color-medium); font-size: 0.9em; }

.day-wind {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--ion-color-medium);
  margin-top: 2px;
}

.day-gust {
  font-size: 0.8rem;
  color: var(--ion-color-warning);
  margin-top: 2px;
}

.rain-chance {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--ion-color-primary);
}

.rain-chance span {
  margin-top: 2px;
}

.no-rain {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--ion-color-warning);
}

/* Section Title */
.section-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin: 20px 16px 10px;
  color: var(--ion-color-dark);
  padding-bottom: 4px;
  border-bottom: 2px solid var(--ion-color-light);
}

/* Utility */
.d-block { display: block; }
.ion-text-center { text-align: center; }

/* Widget Mode */
:host(.widget-mode) ion-content {
  --background: transparent;
  --overflow: hidden;
  height: auto;
  min-height: auto;
}

:host(.widget-mode) ion-content::part(scroll) {
  overflow-y: hidden;
  height: auto;
}

:host(.widget-mode) .container {
  padding-bottom: 0;
}
