/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* ========================================
   TABLET BREAKPOINT (max-width: 768px)
   ======================================== */

@media screen and (max-width: 768px) {
  .weather-dashboard {
    grid-template-columns: 80px 1fr 1fr 1fr 1fr;
    gap: 8px;
    padding: 8px;
    align-items: stretch;
    justify-items: stretch;
    grid-auto-flow: row dense;
  }
  
  .weather-card {
    min-height: 100px;
    height: 100%;
    width: 100%;
  }
  
  /* Reset grid column assignments for tablet */
  .weather-card {
    grid-column: auto !important;
  }
  
  /* Special handling for wide cards on tablet */
  .weather-card[style*="grid-column: 4 / span 3"] {
    grid-column: 3 / span 3 !important;
  }
  
  .weather-card[style*="grid-column: 5 / span 2"] {
    grid-column: 4 / span 2 !important;
  }
  
  .weather-card[style*="grid-column: 2 / span 6"] {
    grid-column: 2 / span 4 !important;
  }
  
  /* Handle sea section cards on tablet */
  .weather-card[style*="grid-column: 6"],
  .weather-card[style*="grid-column: 7"] {
    grid-column: auto !important;
  }
  
  .location-header {
    grid-column: 1 / -1;
    width: 100%;
  }

  .weather-card {
    padding: 15px;
    border-radius: 20px;
    min-height: auto;
    height: auto;
  }

  .weather-card i,
  .weather-card .small-icon {
    font-size: 30px;
    margin-bottom: 6px;
  }
  
  .weather-card .small-icon {
    width: 30px;
    height: 30px;
  }
  
  #compass-rose {
    width: 80px;
    height: 80px;
  }
  
  .warning-card i {
    font-size: 40px;
  }
  
  .tidal-icon i {
    font-size: 25px;
  }

  .weather-card h1 {
    font-size: 1.2em;
    line-height: 1.2;
    margin: 8px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .weather-card h2 {
    font-size: 1.1em;
    line-height: 1.2;
    margin: 8px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .weather-card h3,
  .weather-card h4 {
    font-size: 0.9em;
    line-height: 1.2;
    margin: 5px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .location-header h5 {
    font-size: 2.3em;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .section-label h5 {
    font-size: 1.4em;
    line-height: 1.2;
  }

  .data-attribution {
    font-size: 0.6em;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .section-label {
    grid-column: 1;
    padding: 15px;
    min-height: auto;
    height: auto;
  }

  /* Tablet header layout */
  .header-row {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
  }
  
  .location-header {
    grid-column: 1 / -1;
    width: 100%;
  }
  
  .clock-date-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
  }
  
  .clock-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }
  
  .clock-section h1 {
    font-size: 2.8em;
  }
  
  .clock-section #timezone-indicator {
    font-size: 1.1em;
  }
  
  .header-separator {
    display: none;
  }
  
  .date-section h3 {
    font-size: 1.4em;
  }
  
  .warnings-section {
    grid-template-columns: 80px 1fr;
  }

  .emergency-section {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .emergency-card {
    padding: 15px;
    border-radius: 20px;
  }

  .emergency-card h1 {
    font-size: 1.4em;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .emergency-card h3 {
    font-size: 1em;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .emergency-card ul {
    padding-left: 15px;
    margin: 8px 0;
  }

  .emergency-card li {
    margin: 4px 0;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .tidal-icons-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .tidal-icon {
    padding: 8px;
  }

  .tidal-data {
    font-size: 0.8em;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .disclaimer-section {
    padding: 15px;
    border-radius: 20px;
  }

  .disclaimer-section h1 {
    font-size: 1.4em;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}

/* ========================================
   MOBILE BREAKPOINT (max-width: 480px)
   ======================================== */

@media screen and (max-width: 480px) {
  .weather-dashboard {
    grid-template-columns: 60px 1fr 1fr 1fr 1fr 1fr 1fr;
    gap: 4px;
    padding: 4px;
    grid-auto-flow: row dense;
    align-items: stretch;
    justify-items: stretch;
  }
  
  .weather-card {
    min-height: 60px;
    height: 100%;
    width: 100%;
    padding: 6px;
    border-radius: 15px;
  }
  
  /* Keep original grid assignments but scale down */
  .weather-card {
    grid-column: auto !important;
  }
  
  /* Scale down section labels */
  .section-label {
    grid-column: 1;
    padding: 6px;
    min-height: auto;
    height: auto;
  }
  
  .section-label h5 {
    font-size: 1em;
    line-height: 1.1;
  }
  
  /* Scale down header */
  .header-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 4px;
    margin-bottom: 4px;
  }
  
  .location-header {
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    text-align: center;
    box-sizing: border-box;
  }
  
  .location-header h5 {
    font-size: 2.3em;
    line-height: 1.1;
  }
  
  .clock-date-header {
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    text-align: center;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .clock-section {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
  }
  
  .clock-section h1 {
    font-size: 1.5em;
    font-weight: bold;
    color: #FFFFFF;
    margin: 0;
    font-family: 'Courier New', monospace;
  }
  
  .clock-section #timezone-indicator {
    font-size: 0.6em;
    font-weight: bold;
    color: #FFFFFF;
    margin-left: 5px;
    font-family: 'Courier New', monospace;
    opacity: 1;
  }
  
  .date-section {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
  }
  
  .date-section h3 {
    font-size: 0.8em;
    font-weight: bold;
    color: #FFFFFF;
    margin: 0;
  }
  
  .header-separator {
    width: 1px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.3);
    margin: 0 10px;
  }
  
  .location-header {
    grid-column: 1 / -1;
    width: 100%;
  }

  .weather-card {
    padding: 6px;
    border-radius: 12px;
    min-height: auto;
    height: auto;
  }

  .weather-card i,
  .weather-card .small-icon {
    font-size: 16px;
    margin-bottom: 3px;
  }
  
  .weather-card .small-icon {
    width: 16px;
    height: 16px;
  }
  
  #compass-rose {
    width: 80px;
    height: 80px;
  }
  
  .warning-card i {
    font-size: 25px;
  }
  
  .tidal-icon i {
    font-size: 18px;
  }

  .weather-card h1 {
    font-size: 0.8em;
    line-height: 1.1;
    margin: 4px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .weather-card h2 {
    font-size: 0.7em;
    line-height: 1.1;
    margin: 4px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .weather-card h3,
  .weather-card h4 {
    font-size: 0.6em;
    line-height: 1.1;
    margin: 3px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .location-header h5 {
    font-size: 2.3em;
    line-height: 1.1;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .section-label h5 {
    font-size: 1.2em;
    line-height: 1.1;
  }

  .data-attribution {
    font-size: 0.5em;
    line-height: 1.1;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .section-label {
    grid-column: 1;
    padding: 10px;
    min-height: auto;
    height: auto;
  }

  /* Mobile header layout */
  .header-row {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
  }
  
  .location-header {
    grid-column: 1 / -1;
    width: 100%;
  }
  
  .clock-date-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
  }
  
  .clock-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }
  
  .clock-section h1 {
    font-size: 2.5em;
  }
  
  .clock-section #timezone-indicator {
    font-size: 1em;
  }
  
  .header-separator {
    display: none;
  }
  
  .date-section h3 {
    font-size: 1.2em;
  }
  
  .warnings-section {
    grid-column: 1 / -1 !important;
    grid-template-columns: 60px 1fr !important;
    display: grid;
    gap: 4px;
  }

  .warning-card {
    padding: 10px;
    border-radius: 15px;
  }

  .warning-content {
    padding: 10px;
    border-radius: 15px;
  }

  .warning-content h2 {
    font-size: 1.1em;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .emergency-section {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .emergency-card {
    padding: 10px;
    border-radius: 15px;
  }

  .emergency-card h1 {
    font-size: 1.2em;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .emergency-card h3 {
    font-size: 0.9em;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .emergency-card ul {
    padding-left: 12px;
    margin: 6px 0;
  }

  .emergency-card li {
    margin: 3px 0;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .tidal-icons-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tidal-icon {
    padding: 6px;
  }

  .tidal-data {
    font-size: 0.7em;
    line-height: 1.1;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .disclaimer-section {
    padding: 10px;
    border-radius: 15px;
  }

  .disclaimer-section h1 {
    font-size: 1.2em;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  #qr-code-image {
    width: 100px;
    height: 100px;
  }
} 