/* =========================================
    lifeprint-style.css (v10)
   ========================================= */
body { font-family: Arial, Helvetica, sans-serif; font-size: 18px; line-height: 1.6; margin: 0; padding: 0; color: #000; background: #fff; }
a { text-decoration: none; word-wrap: break-word; overflow-wrap: break-word; color: #0000FF; /* Blue */ }
a:hover { color: #0000FF; /* Keeps text blue on hover */ background-color: #FFFF00; /* Bright Yellow Background */ }
a:visited { color: #0000FF; }
p { margin: 0 0 0.4em 0; }
h1 { text-align: center; font-weight: normal; font-size: 1.8em; color: #000; margin: 10px 10px; }
hr { border: none; border-top: 1px solid #000; margin: 0; padding: 0; }

.center-text { text-align: center; margin: 1px; }

.page-wrap { max-width: 960px; margin: 0 auto; padding: 0 15px; overflow: visible; }
main { padding: 0 10px; }
main blockquote { margin: 0 20px; }
footer { font-size: 0.85em; padding: 4px 10px; }

img { max-width: 100%; height: auto; }

.ad-slot { text-align: center; margin: 12px auto; clear: both; min-height: 100px; }
.ad-slot.top-leaderboard { max-height: 100px; overflow: hidden; min-height: 90px; margin-left: -15px; margin-right: -15px; margin-bottom: 12px; }
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

header { text-align: center; }
.nav-top { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 0 6px; font-size: 20px; font-weight: bold; line-height: 1.2; padding: 0 0; padding-top: 4px; margin: -5px; }
.nav-top form { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 0 6px; margin: 0; padding: 0; line-height: 1.2; font-size: inherit; font-weight: inherit; }
.nav-top a, .nav-top .search-wrap { flex: 0 0 auto; }

#custom-search-input { width: 170px; height: 32px; padding-left: 28px; font-size: 18px; font-weight: bold; box-sizing: border-box; border: 2px solid #ccc; border-radius: 6px; background-color: #fff; transition: all 0.3s ease; }
#custom-search-input:hover { border-color: #1a73e8; background-color: #f8fbff; }
#custom-search-input:focus { outline: none; border-color: #1a73e8; background-color: #fff; box-shadow: 0 0 8px rgba(26, 115, 232, 0.4); }
#custom-search-input::placeholder { color: #888; }

.search-wrap { position: relative; display: inline-block; vertical-align: middle; top: -2px; }
.search-wrap svg { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; fill: #666; pointer-events: none; }
.search-wrap:hover svg { fill: #1a73e8; transition: fill 0.3s ease; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  h1 { font-size: 1.4em; }
  main blockquote { margin: 0 5px; }
  .nav-top { font-size: 16px; }
  #custom-search-input { width: 160px; }
}


/* =========================================
   RAW YOUTUBE EMBEDS STYLING
   ========================================= */
iframe[src*="youtube.com"] {
  width: 100%;
  max-width: 854px;
  aspect-ratio: 16 / 9;
  height: auto;
  display: block;
  margin: 10px auto;
  border: none;
  border-radius: 12px; 
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5); 
}


/* =========================================
   LIFEPRINT VIDEO PLAYER STYLING
   ========================================= */

.video-wrapper {
  max-width: 854px;
  margin: 10px auto; 
  position: relative;
}

.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9; 
  background: #111;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  display: block;
  border: none;
  margin: 0 !important; 
  border-radius: 0 !important; 
  box-shadow: none !important; 
}

/* Custom Player Overlays & Controls */
.play-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; background: transparent; border: 0; padding: 0; margin: 0; cursor: pointer; pointer-events: auto; display: flex; align-items: center; justify-content: center; }
.play-overlay::before { content: ''; width: 68px; height: 48px; background-color: #f00; border-radius: 12px; opacity: 1; transition: opacity 0.2s ease; pointer-events: none; position: relative; }
.play-overlay::after { content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%); width: 0; height: 0; border-style: solid; border-width: 10px 0 10px 18px; border-color: transparent transparent transparent #fff; pointer-events: none; opacity: 1; transition: opacity 0.2s ease; }
.play-overlay.started::before, .play-overlay.started::after { opacity: 0; visibility: hidden; }
.play-overlay.loading::before { animation: pulse 1s infinite; }
.play-overlay.dropped { pointer-events: none; } /* Allow clicks to pass through to YouTube end-screen */
@keyframes pulse { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }

.video-controls { display: flex; flex-wrap: nowrap; gap: 4px; margin-top: 10px; }
.video-controls button { flex: 1; min-width: 0; background: #444; color: #fff; border: none; padding: 18px 4px; font-size: 15px; font-weight: 700; border-radius: 8px; cursor: pointer; white-space: nowrap; transition: background 0.2s ease; }
.video-controls button:hover { background: #cc0000; }
.video-controls button.active { transform: translateY(2px) scale(0.98); background: #008a2e; }

.btn-playpause .icon-play, .btn-playpause .icon-pause { display: inline-block; width: 18px; height: 18px; vertical-align: middle; }
.btn-playpause .icon-play { display: inline-block; }
.btn-playpause .icon-pause { display: none; }
.btn-playpause.playing .icon-play { display: none; }
.btn-playpause.playing .icon-pause { display: inline-block; }
.btn-playpause svg { width: 32px; height: 32px; transform: scale(1.2); } /* Make the play button icon larger than the others. */

.progress-container { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.progress-bar { flex: 1; height: 8px; background: #ccc; border-radius: 4px; position: relative; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; margin: 0 0 0 8px; }
.progress-fill { height: 100%; background: #cc0000; border-radius: 4px; width: 0%; pointer-events: none; }
.progress-handle { position: absolute; left: 0%; top: 50%; transform: translate(-50%, -50%); width: 16px; height: 16px; background: #fff; border: 3px solid #cc0000; border-radius: 50%; cursor: grab; transition: transform 0.1s ease, box-shadow 0.1s ease; z-index: 2; touch-action: none; }
.progress-handle:hover { transform: translate(-50%, -50%) scale(1.2); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.progress-handle.dragging { cursor: grabbing; transform: translate(-50%, -50%) scale(1.3); box-shadow: 0 2px 10px rgba(0,0,0,0.4); }
.progress-handle:focus { outline: none; box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.4), 0 2px 8px rgba(0,0,0,0.3); transform: translate(-50%, -50%) scale(1.2); }

.timecode { padding: 4px 10px; background: #f8f8f8; border: 2px solid #111; color: #111; font-family: monospace; font-size: 17px; font-weight: 700; border-radius: 8px; text-align: center; white-space: nowrap; }
.random-video-wrap { margin-top: 20px; text-align: center; }
.btn-random { background: #222; color: #fff; border: 2px solid #444; padding: 14px 28px; font-size: 16px; font-weight: 700; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; }
.btn-random:hover { background: #cc0000; border-color: #cc0000; }


/* Default: controls-panel wrapper */
.controls-panel { display: block; }


/* =========================================
   PORTRAIT STYLING (LVP)
   ========================================= */
@media screen and (max-width: 600px) and (orientation: portrait) {
  
  .video-controls {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr); /* Exactly 4 buttons per row */
    gap: 6px;
    margin-top: 8px;
  }

  .video-controls button {
    flex: none; /* Disables flexbox stretching */
    padding: 10px 2px; /* Less vertical padding */
    font-size: 15px; /* Standardized text size */
    min-height: 40px; /* Ensures they are still tappable by thumbs */
  }

  /* Make the SVG Play icon fit nicely in the new grid */
  .btn-playpause .icon-play, 
  .btn-playpause .icon-pause {
    width: 22px;
    height: 22px;
  }

   /*  EDGE-TO-EDGE VIDEO (Portrait Mobile) */
  .video-container {
    margin-left: -15px;
    margin-right: -15px;
    width: calc(100% + 30px);
    max-width: none;
    border-radius: 0; /* Removes the rounded corners so it looks flush against the screen */
  }
}


/* =========================================
   LANDSCAPE STYLING (LVP)
   ========================================= */

@media screen and (max-height: 480px) and (orientation: landscape) { 

  .video-wrapper {
    display: flex !important;
    flex-direction: row;
    align-items: flex-start;
    gap: 30px;  /* area to the left of the buttons */
    width: 100%;
    max-width: none !important;
    margin: 5px -15px 5px -15px !important; /* reduce left and right margins - video nearer to edge */
    padding: 0;
    overflow: visible;
  }

  .video-container {
    flex: 1 1 auto;
    width: auto;
    max-width: calc(100vw - 200px);
    aspect-ratio: 16 / 9;
    height: auto;
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
  }

  .controls-panel {
    display: flex !important;
    flex-direction: column;
    flex: 0 0 180px;
    width: 180px;
    min-width: 180px;
    max-width: 180px;
    max-height: none;
    overflow: visible;
    padding-right: 0;
    gap: 14px;
  }

  .video-controls {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 0;
  }

  .video-controls button {
    flex: none;
    min-width: 0;
    min-height: 30px;
    padding: 7px 4px;
    font-size: 12px;
    line-height: 1.2;
  }

  .progress-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
gap: 20px; /* below progress bar */
margin: 0 0 0 11px; /* left of progress bar */
}

    /* Progress bar */
  .progress-bar {
    width: 100%;
    min-height: 10px;
    background: #888 !important;
    border-radius: 5px;
    position: relative;
  }
  
  .progress-fill {
    width: 0%;
    height: 100%;
    display: block;
    min-width: 1px;
    background: #cc0000;
    border-radius: 5px;
  }
  

  .progress-handle {
    width: 16px;
    height: 16px;
  }

.timecode {
    align-self: center;
    font-size: 20px;
    padding: 3px 10px;
    text-align: center;
    width: fit-content;
    font-family: monospace; 
}

  .random-video-wrap { 
	margin-top: 10px; 
	text-align: center; 
  }

  .random-video-wrap .btn-random {
    width: 100%;
    padding: 7px 4px;
    font-size: 11px;
    line-height: 1.2;
  }
}


/* =========================================
   FOOTER SEARCH BAR STYLING
   ========================================= */

.search-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    float: right;
    width: 60%;
    height: 35px;
    margin: 10px 0 10px 20px;
}
.search-bar b {
    white-space: nowrap;
    position: relative;
    z-index: 10;
    font-size: 20px;
}
.search-bar .gcse-wrap {
    flex: 1;
    margin-left: 4px;
}
@media (max-width: 600px) {
    .search-bar {
        float: none;
        width: 100%;
        justify-content: flex-start;
        margin: 10px 0 10px 20px;
    }
    .search-bar .gcse-wrap {
        flex: 1;
        width: auto;
        margin-left: 4px;
    }
    .search-bar .gcse-wrap .gsc-control-cse,
    .search-bar .gcse-wrap .gsc-search-box,
    .search-bar .gcse-wrap table.gsc-search-box {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}
.search-bar .gcse-wrap .gsc-control-cse,
.search-bar .gcse-wrap .gsc-search-box,
.search-bar .gcse-wrap table.gsc-search-box {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}


/* =========================================
   CUSTOM RIGHT-CLICK / CLICK-AND-HOLD MENU
   ========================================= */
.custom-context-menu {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 50;
  display: none;
  min-width: 250px;
  background: rgba(24, 24, 24, 0.98);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.55);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.custom-context-menu.is-open {
  display: block;
}

.custom-context-menu .menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: #fff;
  border: 0;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.custom-context-menu .menu-item:hover,
.custom-context-menu .menu-item:focus {
  background: rgba(255,255,255,0.12);
  outline: none;
}

/* =========================================
   FULLSCREEN BUTTON (Desktop/Large Screens)
   ========================================= */
.btn-fullscreen {
  background: transparent;
  color: #111;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.btn-fullscreen svg {
  width: 30px;
  height: 30px;
}

.btn-fullscreen .icon-expand {
  display: block;
}

.btn-fullscreen .icon-contract {
  display: none;
}

.btn-fullscreen:hover {
  color: #cc0000;
  transform: scale(1.1);
}

/* Hide fullscreen icon on small screens (phones use long-press or rotate) */
@media screen and (max-width: 700px) {
  .btn-fullscreen { display: none; }
}

/* In fullscreen, use the contract icon and make it high-contrast */
.video-wrapper:fullscreen .btn-fullscreen,
.video-wrapper:-webkit-full-screen .btn-fullscreen {
  color: #fff;
}

.video-wrapper:fullscreen .btn-fullscreen:hover,
.video-wrapper:-webkit-full-screen .btn-fullscreen:hover {
  color: #ff6b6b;
}

.video-wrapper:fullscreen .btn-fullscreen .icon-expand,
.video-wrapper:-webkit-full-screen .btn-fullscreen .icon-expand {
  display: none;
}

.video-wrapper:fullscreen .btn-fullscreen .icon-contract,
.video-wrapper:-webkit-full-screen .btn-fullscreen .icon-contract {
  display: block;
}

/* =========================================
   FULL SCREEN MODE ADJUSTMENTS
   ========================================= */
.video-wrapper:fullscreen,
.video-wrapper:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 16px !important;
  box-sizing: border-box;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.video-wrapper:fullscreen .video-container,
.video-wrapper:-webkit-full-screen .video-container {
  width: min(100%, calc((100vh - 180px) * 16 / 9));
  max-width: 100%;
  max-height: calc(100vh - 180px);
  aspect-ratio: 16 / 9;
  flex: 0 1 auto;
  margin: 0 auto;
}

.video-wrapper:fullscreen .controls-panel,
.video-wrapper:-webkit-full-screen .controls-panel {
  width: min(1100px, 100%);
  max-width: 100%;
  flex: 0 0 auto;
}

.video-wrapper:fullscreen .progress-container,
.video-wrapper:-webkit-full-screen .progress-container {
  width: 100%;
}

.video-wrapper:fullscreen iframe[src*="youtube.com"],
.video-wrapper:-webkit-full-screen iframe[src*="youtube.com"] {
  max-width: none !important;
  aspect-ratio: auto !important;
}