﻿/* ============================================================
   IsraelBeachCams  Shared Styles  (v3 Redesign)
   Camera region pages  RTL  Heebo  Responsive
   ============================================================ */

/*  Design Tokens (same as index, repeated for standalone use) */
:root {
  --bg-deep:    #060E1D;
  --bg-main:    #0A1628;
  --bg-card:    #0E1F3A;
  --bg-card-2:  #112244;
  --teal:       #00C9D4;
  --teal-dark:  #009BA5;
  --orange:     #FF6135;
  --text-h:     #EBF3FF;
  --text-body:  #9BB5D6;
  --text-dim:   #5A7899;
  --white:      #FFFFFF;
  --live-red:   #FF2D55;
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --shadow-card: 0 8px 32px rgba(0,0,0,0.45);
  --transition:  all 0.28s cubic-bezier(0.4,0,0.2,1);
}

/*  Base  */
html, body { overflow-x: hidden; width: 100%; max-width: 100vw; }

body {
  font-family: 'Heebo', sans-serif !important;
  background-color: #fff;
  color: var(--text-body);
  direction: rtl;
  padding-top: 64px;
  line-height: 1.6;
  margin: 0;
}

body, div, h1, h2, p { direction: rtl; text-align: right; }

*, *::before, *::after { box-sizing: border-box; }

/*  Navbar  */
nav, footer {
  background-color: var(--bg-deep) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.navbar {
  background-color: var(--bg-deep) !important;
  border-bottom: 1px solid rgba(0,201,212,0.12);
  padding: 0 !important;
  height: 64px !important;       /* prevent flex-wrap from growing the bar */
  overflow: visible !important;  /* don't clip the fixed dropdown */
  transition: var(--transition);
}

a.navbar-brand { padding: 10px 16px; margin: 0; }
.navbar-brand img { height: 38px; width: auto; }

a.nav-link {
  color: var(--text-h) !important;
  font-weight: 500;
  font-size: 0.88rem;
  padding: 0 11px !important;
  line-height: 64px !important;
  transition: color 0.2s;
  white-space: nowrap;
}

a.nav-link:hover { color: var(--teal) !important; }
.nav-item.active a.nav-link { color: var(--teal) !important; }

.navbar-toggler {
  border-color: rgba(0,201,212,0.35) !important;
  margin-left: 12px;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0,201,212,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

ul.navbar-nav.ml-auto { padding-right: 0; }

/*  Page container  */
main.container-fluid,
.cams-container {
  max-width: 1280px;
  margin: 15px auto;
  padding: 10px 16px 24px; /* padding-top: 10px as requested */
  background-color: #fff;
}

main.container-fluid h1 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: #1a2a3a;             /* dark on white background */
  border-bottom: 2px solid var(--teal);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

main.container-fluid h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 600;
  color: #1a2a3a;             /* dark on white background */
  border-bottom: 1px solid rgba(0,150,160,0.3);
  padding-bottom: 6px;
  margin: 24px 0 10px;
}

main.container-fluid h3 {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 600;
  color: #1a2a3a;
  margin: 20px 0 8px;
}

main.container-fluid p { color: #444; font-size: 0.95rem; }
/*  Camera Card (in region pages)  */
.card {
  background-color: var(--bg-card) !important;
  border: 1px solid rgba(0,201,212,0.1) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-card) !important;
  margin-bottom: 24px;
  overflow: hidden;
  transition: var(--transition);
  color: var(--text-body) !important;
}

.card.camera-card {
  position: relative; /* anchor for .ad-overlay absolute positioning */
  /* iframes break overflow:hidden clipping — force GPU compositing layer to fix it */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  border: 0 !important;
}

/* All inner media elements — round the bottom corners to match the card */
.card.camera-card iframe,
.card.camera-card lite-youtube,
.card.camera-card > a,
.card.camera-card .custom-embed,
.card.camera-card .youtube-lazy {
  display: block;
  border-bottom-left-radius: calc(var(--radius-lg) - 1px);
  border-bottom-right-radius: calc(var(--radius-lg) - 1px);
  overflow: hidden;
}

/* <a>-wrapped image cards (e.g. Sokolov Nahariya) */
.card.camera-card > a img {
  display: block;
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-bottom-left-radius: calc(var(--radius-lg) - 1px);
  border-bottom-right-radius: calc(var(--radius-lg) - 1px);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6) !important;
  border-color: rgba(0,201,212,0.25) !important;
}

.card-title {
  font-size: 1rem !important;
  font-weight: 600 !important;
  color: var(--text-h) !important;
  text-align: right !important;
  padding: 14px 16px 8px !important;
  margin: 0 !important;
  border-bottom: 1px solid rgba(0,201,212,0.1);
}

.card .desc {
  padding: 10px 16px 14px;
  font-size: 0.85rem;
  color: var(--text-dim);
  min-height: 60px;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.card-body { padding: 0 !important; }

/*  Video wrapper  */
iframe {
  height: 300px;
  width: 100%;
  border: none;
  display: block;
}

.video-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative;
  background: #000;
  border-radius: 0;
}

.video-wrapper lite-youtube {
  width: 1280px !important;
  height: 720px !important;
  position: absolute;
  top: 0;
  right: 0;
  transform-origin: top right;
  transform: scale(0.42);
  max-width: none;
}

.video-wrapper lite-youtube iframe {
  width: 1280px !important;
  height: 720px !important;
}

.lty-playbtn { zoom: 3; }

/*  Play button overrides  */
.play-button-icon { height: 300px; width: 100%; }

.ipc-bigPlayBase {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 1;
  width: 100px;
  height: 100px;
  position: absolute;
  pointer-events: none;
}

.orange-icon {
  background-image: url('https://g2.ipcamlive.com/player/html5player/images-5/orange/bigplay.png') !important;
  background-position: -96px center !important;
  background-repeat: no-repeat !important;
  background-color: transparent !important;
  opacity: 1 !important;
  display: block !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
}

.icon-locked { pointer-events: none !important; cursor: wait !important; }

.icon-ready {
  pointer-events: auto !important;
  cursor: pointer !important;
  animation: pulse-orange 1.5s infinite;
}

@keyframes pulse-orange {
  0%   { transform: scale(1); filter: brightness(1); }
  50%  { transform: scale(1.1); filter: brightness(1.3); }
  100% { transform: scale(1); filter: brightness(1); }
}

/*  Links  */
a.cameraPageLink, a.camLink {
  color: var(--text-h);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  margin: 7px;
}

a.cameraPageLink:hover, a.camLink:hover {
  color: var(--teal);
  text-decoration: none;
}

/*  Ads  */
.ad-banner {
  text-align: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.ads-container {
  position: relative;
  top: 20px;
  margin-bottom: 10px;
}

.ads-container .card img {
  width: 100%;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  height: 250px;
  pointer-events: none;
}

.ads-container a { text-decoration: none; color: var(--text-h); display: inline-block; }

.ad-overlay {
  display: none !important;
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(6, 14, 29, 0.92);
  border-radius: var(--radius-lg);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}

.ad-overlay.show {
  display: flex !important;
}

.ad-overlay ins.adsbygoogle {
  display: inline-block !important;
  background: #ffffff;
  border-radius: var(--radius-sm);
  width: 336px;
  height: 280px;
  max-width: 100%;
  margin: 0 auto;
}

/*  404 / Error  */
.bg-404, .error-image { text-align: center; margin: 80px 0 40px 0; }
.bg-404 .error-image img { margin-top: 20px; }
section#error-page { margin-bottom: 20px; }

/*  Misc  */
.card-img, .card-image { padding: 0 !important; }
img.card-image, .card-img img { width: 100%; }
img.card-image { height: 400px; }
.card-img img#sdotYam { height: 392px; }

a#sdot-yam { display: inline-block; margin: 20px 7px 25px 0; }

.rishon { overflow: hidden; }
.rishon iframe { width: 905px !important; }

.display-3 { font-size: 3rem !important; }
.lead { font-size: 1.5rem !important; }

/*  Section title used in region pages  */
.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text-h);
  text-align: center;
  margin: 36px 0 24px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--teal);
  border-radius: 2px;
  margin: 8px auto 0;
}

/*  Footer  */
footer {
  background-color: var(--bg-deep) !important;
  border-top: 1px solid rgba(0,201,212,0.1) !important;
  padding: 48px 0 24px !important;
  margin-top: 40px;
}

footer h4 {
  color: var(--teal) !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  margin-bottom: 14px !important;
  text-align: center;
}

footer p { font-size: 0.85rem !important; color: var(--text-dim) !important; text-align: center; }

footer ul {
  list-style: none;
  display: block !important;
  padding: 0;
  margin: 0;
}

footer ul li { display: block !important; margin-bottom: 8px; text-align: center; }

footer ul li a {
  color: var(--text-body) !important;
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 0.2s;
}

footer ul li a:hover { color: var(--teal) !important; }

/* ─── Hide camera descriptions ─────────────────────────────── */
.card .desc,
.camera-card .desc {
  display: none !important;
}

/*  Mobile  */
@media only screen and (max-width: 992px) {
  html, body, .container-fluid, .container, main {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }

  .navbar-collapse {
    /* position: fixed = viewport-relative, completely outside navbar's flex flow */
    position: fixed;
    top: 64px;
    right: 0;
    left: 0;
    z-index: 1050;
    width: 100%;
    background-color: var(--bg-deep);
    border-top: 1px solid rgba(0,201,212,0.12);
    border-bottom: 1px solid rgba(0,201,212,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
    padding: 8px 0 12px;
  }

  /* Kill Bootstrap's height transition entirely — replace with CSS animation */
  .navbar-collapse.collapsing {
    height: auto !important;
    overflow: hidden !important;
    transition: none !important;
  }

  .navbar-collapse.show {
    animation: navSlideDown 0.24s ease both;
  }

  @keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .navbar-nav { width: 100%; }
  .nav-item   { width: 100%; }

  a.nav-link {
    line-height: 1.4 !important;
    padding: 11px 20px !important;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    text-align: right !important;
  }

  body { padding-top: 64px; }

  /* desc is hidden globally — no override needed */

  .play-button-icon { height: 163px !important; }

  /* custom-embed / youtube-lazy use padding-bottom:56.25% which ignores min-height;
     switch to aspect-ratio + min-height so the card is always tall enough for the 300×250 ad.
     Also applies to <a>-wrapped image cards (e.g. Sokolov Nahariya). */
  .card.camera-card .custom-embed,
  .card.camera-card .youtube-lazy {
    height: auto !important;
    padding-bottom: 0 !important;
    aspect-ratio: 16 / 9;
    min-height: 280px;
  }

  /* Sokolov-style cards: <a> wrapper around <img> */
  .card.camera-card > a.camLink,
  .card.camera-card > a[href]:has(img) {
    min-height: 280px;
  }

  .card.camera-card > a.camLink img,
  .card.camera-card > a[href]:has(img) img {
    min-height: 280px !important;
    height: 280px !important;
  }

  .ipc-bigPlayBase {
    height: 55px !important;
    width: 55px !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background-size: 110px auto !important;
    background-repeat: no-repeat !important;
    background-position: 0 center !important;
  }

  div#mediaplaybackdiv_ipc_ic_bigPlay {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
  }

  /* sprite: white icon = left half (0), orange = right half (-55px) */
  .orange-icon {
    background-size: 110px auto !important;
    background-position: -55px center !important;
  }

  .video-wrapper lite-youtube {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    transform: scale(0.255) !important;
    transform-origin: top right;
    position: absolute;
    top: 0;
    right: 0;
  }

  .video-wrapper lite-youtube iframe {
    width: 100% !important;
    height: 100% !important;
  }

  .video-wrapper {
    height: 250px;
    position: relative;
    overflow: hidden;
    background: #000;
  }

  img.card-image { height: 250px; }

  .col-xs-12 { padding: 0 !important; }

  /* Fullscreen on mobile */
  .video-wrapper lite-youtube:fullscreen,
  .video-wrapper lite-youtube:-webkit-full-screen {
    width: 100vw !important; height: 100vh !important;
    max-width: 100vw !important; max-height: 100vh !important;
    transform: none !important; position: fixed !important;
    top: 0 !important; left: 0 !important;
    right: 0 !important; bottom: 0 !important;
    margin: 0 !important; padding: 0 !important; z-index: 9999 !important;
  }

  .video-wrapper lite-youtube:fullscreen iframe,
  .video-wrapper lite-youtube:-webkit-full-screen iframe {
    width: 100% !important; height: 100% !important;
    transform: none !important; position: absolute !important;
    top: 0 !important; left: 0 !important;
  }
}

@media only screen and (max-width: 992px) and (orientation: landscape) {
  .video-wrapper { height: 300px; }
  .video-wrapper lite-youtube { transform: scale(0.38) !important; }
}

/* iframe fullscreen across all browsers */
iframe:fullscreen,
iframe:-webkit-full-screen,
iframe:-moz-full-screen,
iframe:-ms-fullscreen {
  width: 100% !important; height: 100% !important;
  position: fixed !important; top: 0 !important; left: 0 !important;
  right: 0 !important; bottom: 0 !important;
  margin: 0 !important; padding: 0 !important;
  border: none !important; background: #000 !important;
}

/* ============================================================
   🏄 Surf Products Page
   ============================================================ */

/* Hero banner */
.hero {
  background: linear-gradient(rgba(6,14,29,0.72), rgba(6,14,29,0.72)),
              url('../vendor/media/surf-gear.webp') center / cover no-repeat;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: #fff !important;
  border: none !important;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  margin-bottom: 0.8rem;
}

.hero p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.85) !important;
  max-width: 580px;
  margin: 0 auto;
}

/* Filter bar */
.filters {
  padding: 1.2rem 0;
  background: var(--bg-card);
  border-bottom: 1px solid rgba(0,201,212,0.12);
  position: sticky;
  top: 64px;
  z-index: 100;
}

.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-direction: row !important;
}

.filter-btn {
  background: var(--bg-card-2);
  color: var(--text-body);
  border: 1px solid rgba(0,201,212,0.2);
  padding: 0.55rem 1.2rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.22s ease;
  font-family: 'Heebo', sans-serif;
  font-weight: 500;
  font-size: 0.88rem;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--teal);
  color: var(--bg-deep);
  border-color: var(--teal);
  transform: translateY(-1px);
}

/* Products section wrapper */
.products-section {
  padding: 2rem 0 3rem;
  background-color: var(--bg-main);
}

.products-section .section-title {
  color: var(--teal);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  text-align: center;
  margin-bottom: 2.5rem;
  border: none;
}

.products-section .section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--teal);
  border-radius: 2px;
  margin: 8px auto 0;
}

/* Category block */
.category-section { margin: 2rem 0; }

.category-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-h) !important;
  border-bottom: 2px solid var(--teal) !important;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  text-align: right;
}

/* Product grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

/* Product card */
.product-card {
  background: var(--bg-card);
  border: 1px solid rgba(0,201,212,0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  text-decoration: none !important;
  color: inherit !important;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.55);
  border-color: rgba(0,201,212,0.28);
  text-decoration: none !important;
}

.product-image {
  height: 200px;
  overflow: hidden;
  background: var(--bg-card-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-image img { transform: scale(1.06); }

.product-content {
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-title {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text-h);
  margin-bottom: 0.35rem;
}

.product-description {
  color: var(--text-body);
  font-size: 0.83rem;
  margin-bottom: 0.7rem;
  flex-grow: 1;
}

.product-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 0.6rem;
}

.product-badge {
  background: var(--teal);
  color: var(--bg-deep);
  padding: 0.22rem 0.7rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-block;
  align-self: flex-start;
}

/* CTA section */
.cta-section {
  background: var(--bg-card);
  border-top: 1px solid rgba(0,201,212,0.12);
  text-align: center;
  padding: 3rem 0;
}

.cta-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--teal);
  margin-bottom: 0.8rem;
}

.cta-description {
  font-size: 1rem;
  color: var(--text-body);
  margin-bottom: 1.4rem;
}

.cta-button {
  background: var(--teal);
  color: var(--bg-deep);
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Heebo', sans-serif;
}

.cta-button:hover {
  background: #00e4f0;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,201,212,0.35);
}

/* Mobile */
@media (max-width: 767px) {
  .hero { height: 240px; }
  .hero h1 { font-size: 1.6rem !important; }
  .filter-btn { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.85rem; }
  .product-image { height: 160px; }
  .filters { top: 64px; }
}

/* ══════════════════════════════════════
   📊 Expanded Forecasts — Plotly wrapper
   ══════════════════════════════════════ */
.expanded-forecasts {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px 12px 24px;
  margin: 16px 0 32px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
  border: 1px solid rgba(0, 201, 212, 0.12);
  overflow: hidden;
}

.expanded-forecasts .plotly-graph-div {
  border-radius: var(--radius-md);
  overflow: hidden;
  display: block;
}

/* Camera page link – added by add_camera_links.py */
.camera-page-link {
    display: inline-block;
    padding-right: 10px;
    margin: 8px 0 4px;
    font-size: 0.85rem;
    color: #1a73e8;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.camera-page-link:hover {
    color: #0d47a1;
    text-decoration: underline;
}
