/* Desktop-specific styles */

/* Desktop layout - horizontal images with text underneath */
@media (min-width: 768px) {
  /* Remove video borders and outlines */
  video {
    outline: none !important;
    border: none !important;
  }
  
  /* Less visible border on desktop */
  .video-placeholder-overlay {
    border: none !important;
    background: #000 !important;
    isolation: isolate !important;
    box-shadow: none !important;
  }

  .video-placeholder-overlay:not(.hidden)::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22) !important;
    pointer-events: none !important;
    z-index: 2 !important;
  }

.video-placeholder-overlay.loading {
    background: #000 !important;
  }

  .video-placeholder-overlay.loading img {
    animation: video-placeholder-opacity-pulse 1.05s ease-in-out infinite !important;
  }

  @keyframes video-placeholder-opacity-pulse {
    0%, 100% {
      opacity: 1;
    }
    50% {
      opacity: 0.38;
    }
  }
  
  .weather-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
  }
  
  .weather-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 49.2%;
    width: 49.2%;
    align-self: flex-start;
    justify-content: flex-start;
    position: relative;
    min-height: 400px; /* Ensure minimum height for alignment */
  }
  
  .weather-item img {
    max-width: 100%;
    width: 100%;
    margin: 0 0 8px 0;
  }
  
  /* First and second weather item images should have pointer cursor */
  .weather-item:first-child img,
  .weather-item:nth-child(2) img {
    cursor: pointer;
  }
  
  .weather-info {
    padding: 0 1rem;
    min-height: 0;
    display: flex;
    align-items: flex-start;
  }

  #forecast-text,
  #status-text {
    min-height: 0;
    height: auto;
    display: block;
  }

  #forecast-text > div {
    width: 100%;
  }

  #forecast-text > div > div + div {
    margin-top: 6px !important;
  }
  
  .status-text {
    padding-left: 1rem;
  }
  
  .footer {
    padding: 10px 0; /* add vertical padding on desktop */
    text-align: center;
  }
  
  .weather-item:last-child .weather-info {
    margin-bottom: 0;
  }
  
  /* Desktop widgets - same width as images */
  .desktop-widget {
    width: 100%;
    max-width: 100%;
    margin-top: 15px;
    align-self: flex-start;
    min-height: 327px;
    position: relative;
    display: block;
  }

  /* Desktop WindGuru widget positioning */
  #desktop-windguru-container {
    align-self: flex-start;
    position: relative;
    display: block !important;
    visibility: visible !important;
    min-height: 327px; /* match video/map height for alignment */
  }

  /* Ensure WindGuru widget inside desktop container fills width */
  #desktop-windguru-widget table,
  #desktop-windguru-widget iframe,
  #desktop-windguru-widget div[id*="wg_fwdg_"] {
    width: 100% !important;
    max-width: 100% !important;
    transform: scale(1) !important;
  }
  
  /* Ensure video and widget are aligned by bottom edge */
  #desktop-webcam-container {
    align-self: flex-end;
    position: relative;
    bottom: 3px;
  }
  
  #desktop-windguru-container {
    align-self: flex-start;
    position: relative;
    display: block !important;
    visibility: visible !important;
    min-height: 200px;
  }

  .widget-update-time {
    position: absolute;
    top: 3px;
    right: 5px;
    left: auto;
    z-index: 10;
    width: auto !important;
    max-width: none !important;
    display: inline-block;
    width: fit-content !important;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(0, 0, 0, 0.72);
    font-size: 13px;
    line-height: 1.2;
    font-weight: 500;
    pointer-events: none;
    white-space: nowrap;
    text-align: right;
  }

  .widget-update-time-text {
    display: inline-block;
    padding: 2px 4px 2px 39px;
    border-radius: 2px;
    background: rgb(244, 244, 244);
  }

  .widget-update-time-value {
    font-weight: 700;
  }
  
  .desktop-widget iframe,
  .desktop-widget table,
  .desktop-widget div,
  .desktop-widget video {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .desktop-widget video {
    outline: none !important;
    border: none !important;
    background: #000 !important;
  }

  .desktop-widget video::-webkit-media-controls-enclosure,
  #desktop-valencia-stream::-webkit-media-controls-enclosure,
  #desktop-pobla-stream::-webkit-media-controls-enclosure,
  #desktop-oliva-stream::-webkit-media-controls-enclosure {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .desktop-widget video::-webkit-media-controls-panel,
  #desktop-valencia-stream::-webkit-media-controls-panel,
  #desktop-pobla-stream::-webkit-media-controls-panel,
  #desktop-oliva-stream::-webkit-media-controls-panel {
    border: none !important;
    box-shadow: none !important;
    background-image: none !important;
  }

  #desktop-webcam-container > div {
    background: #000 !important;
  }
  
  /* Force WindGuru widget to full width */
  .desktop-widget table,
  .desktop-widget iframe,
  .desktop-widget div[id*="wg_fwdg_"] {
    width: 100% !important;
    max-width: 100% !important;
    transform: scale(1) !important;
  }
  
  /* Force video to fill container */
  #desktop-valencia-stream,
  #desktop-pobla-stream,
  #desktop-oliva-stream {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
  }
}
