/* View Styles - Common for all views */

#home-view {
  padding-bottom: 80px; /* Space for bottom navigation */
}


#sea-forecast-view {
  padding-bottom: 80px; /* Space for bottom navigation */
  max-width: 1200px;
  margin: 0 auto;
}

#air-forecast-view {
  padding-bottom: 80px; /* Space for bottom navigation */
  max-width: 1200px;
  margin: 0 auto;
}

#history-view {
  padding-bottom: 80px; /* Space for bottom navigation */
  max-width: 1200px;
  margin: 0 auto;
}

.history-content {
  padding: 0;
}

/* Page Header - Unified header for all non-home views */
.page-header {
  text-align: center;
  padding: 24px 16px;
  background: var(--md-sys-color-surface);
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0 0 8px 0;
  font-size: 2rem;
  color: var(--md-sys-color-on-surface);
}

.page-header p {
  margin: 0;
  color: var(--md-sys-color-on-surface-variant);
}

/* Forecast Section */
.forecast-section {
  margin: 0 0 40px 0;
  padding: 0 16px;
}

.forecast-section h2 {
  font-size: 1.5rem;
  margin: 0 0 20px 0;
  color: var(--md-sys-color-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* History Tabs */
.history-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--md-sys-color-surface-variant);
  border-radius: 8px;
}

.history-tab-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-tab-btn:hover {
  background: var(--md-sys-color-surface-container-high);
}

.history-tab-btn.active {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .history-tabs {
    flex-direction: column;
  }

  .history-tab-btn {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
}

/* Table Container Styles */
.forecast-table-container {
  padding: 0;
  overflow: hidden;
  margin-bottom: 24px;
}

.forecast-table-container .md-table {
  border-radius: 12px;
}

/* Conditions column - icon only */
.conditions-col {
  width: 50px;
  text-align: center;
  padding: 8px !important;
}

.condition-icon {
  font-size: 2rem;
  line-height: 1;
  display: inline-block;
}

/* SVG condition icons */
.condition-svg {
  width: 32px;
  height: 32px;
  display: inline-block;
  vertical-align: middle;
  color: inherit;
}

/* Weather Icons font icons */
.condition-icon-font {
  font-size: 32px;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
  color: inherit;
}

.md-table td.conditions-cell {
  text-align: center;
  padding: 12px 8px !important;
  width: 50px;
  vertical-align: middle;
}

.md-table td.conditions-cell .condition-icon {
  font-size: 2rem;
}

.md-table td.conditions-cell .condition-svg {
  width: 32px;
  height: 32px;
}

/* Chart Container Styles */
.forecast-chart-container {
  background: var(--md-sys-color-surface);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-top: 16px;
}

.forecast-chart-container canvas {
  max-height: 300px;
}

/* Responsive table adjustments */
@media (max-width: 768px) {
  .forecast-table-container {
    margin-bottom: 16px;
  }

  .forecast-chart-container {
    padding: 16px;
  }

  .md-table {
    font-size: 0.8rem;
  }

  .md-table th,
  .md-table td {
    padding: 10px 6px;
  }

  .conditions-col {
    width: 40px;
  }

  .md-table td.conditions-cell {
    width: 40px;
    padding: 8px 4px !important;
  }

  .condition-icon {
    font-size: 1.5rem;
  }

  .condition-svg {
    width: 28px;
    height: 28px;
  }

  .condition-icon-font {
    font-size: 28px;
  }

  .md-table td.conditions-cell .condition-svg {
    width: 28px;
    height: 28px;
  }

  .md-table td.conditions-cell .condition-icon-font {
    font-size: 28px;
  }
}

@media (min-width: 769px) {
  /* Desktop: Optimize column widths */
  .md-table th:nth-child(2),
  .md-table td:nth-child(2) {
    width: 120px;
  }

  .md-table th:nth-child(3),
  .md-table td:nth-child(3) {
    width: 130px;
  }

  .md-table th:nth-child(4),
  .md-table td:nth-child(4) {
    width: 120px;
  }

  .md-table th:nth-child(5),
  .md-table td:nth-child(5) {
    width: 120px;
  }

  .md-table th:nth-child(6),
  .md-table td:nth-child(6) {
    width: 90px;
  }
}


/* Bottom Navigation */
.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--md-sys-color-surface);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  padding: 8px 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 1000;
  transform: translateZ(0); /* Force GPU acceleration */
}

.bottom-nav-container {
  display: flex;
  justify-content: space-around;
  width: 100%;
  max-width: 600px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--md-sys-color-on-surface-variant);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  flex: 1;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;

  /* Increase tap target size */
  min-height: 64px;
}

/* Add ripple effect background */
.nav-item::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
}

.nav-item:active::before {
  width: 48px;
  height: 48px;
  opacity: 0.15;
}

.nav-item:hover {
  color: var(--md-sys-color-primary);
  background: rgba(102, 126, 234, 0.08);
}

.nav-item.active {
  color: var(--md-sys-color-primary);
  background: rgba(102, 126, 234, 0.12);
}

.nav-item-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item-icon svg {
  width: 26px;
  height: 26px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.nav-item:active .nav-item-icon {
  transform: scale(0.9);
}

.nav-item.active .nav-item-icon svg {
  transform: scale(1.15);
}

.nav-item:hover .nav-item-icon svg {
  transform: scale(1.1);
}

.nav-item-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1px;
  transition: font-weight 0.2s ease;
}

.nav-item.active .nav-item-label {
  font-weight: 600;
}

/* Mobile touch optimization */
@media (hover: none) and (pointer: coarse) {
  .nav-item {
    /* Larger touch target on mobile */
    padding: 14px 18px;
    min-height: 68px;
  }

  .nav-item-icon svg {
    width: 28px;
    height: 28px;
  }

  .nav-item:active {
    background: rgba(102, 126, 234, 0.2);
  }

  .nav-item:active .nav-item-icon {
    transform: scale(0.85);
  }
}

/* View transition animation */
.view {
  transition: opacity 0.2s ease-in-out;
  opacity: 1;
}

.view-fade-in {
  animation: fadeIn 0.2s ease-in;
}

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


/* About View Styles (PWA + Notifications) */
#about-view {
  padding-bottom: 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.install-hero {
  background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, var(--md-sys-color-primary-container) 100%);
  color: var(--md-sys-color-on-primary);
  padding: 60px 20px;
  text-align: center;
  margin-bottom: 40px;
  border-radius: 0;
}

.install-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  font-weight: 600;
}

.install-hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

.step-card {
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--md-sys-color-outline-variant);
  transition: all 0.2s ease;
}

.step-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.step-number {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-bottom: 15px;
}

.platform-section {
  margin-bottom: 50px;
  padding: 0 16px;
}

.platform-title {
  color: var(--md-sys-color-on-background);
  font-size: 1.8rem;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 48px;
}

.platform-icon {
  font-size: 2rem;
}

.benefit-card {
  text-align: center;
  padding: 20px;
  background: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
  border-radius: 12px;
  margin-bottom: 20px;
  height: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.benefit-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.benefit-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  color: var(--md-sys-color-primary);
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
  padding: 0 16px;
}

.pwa-content {
  padding: 0;
}

@media (max-width: 768px) {
  .install-hero h1 {
    font-size: 2rem;
  }

  .install-hero p {
    font-size: 1.1rem;
    padding: 0 15px;
  }

  .step-card {
    padding: 20px;
    margin-bottom: 20px;
  }

  .platform-title {
    font-size: 1.5rem;
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .benefits-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .benefit-card {
    margin-bottom: 16px;
    padding: 16px;
  }
}

@media (max-width: 575px) {
  .install-hero {
    padding: 40px 15px;
  }

  .benefit-icon {
    font-size: 2.5rem;
  }

  .benefit-card {
    padding: 16px 12px;
  }

  .platform-section {
    padding: 0 12px;
  }
}
