/*
Theme Name: KR Live Theme
Author: Raymond / KontaktRadio
Description: Modern 'Broadcast' thema met donkere modus, live player en chat integratie.
Version: 2.0
*/

/* --- 1. VARIABELEN & RESET --- */
:root {
  --kr-blue: #103E66;
  --kr-blue-2: #2D6399;
  --kr-gold: #BA922D;
  --kr-gray: #CBCBC3;
  
  /* Layout kleuren */
  --bg: #0b1522;
  --card: #0f1f33;
  --text: #ffffff;
  --muted: #cfd6df;
  --border: #1f3350;
  
  /* Afmetingen */
  --container-width: 1200px;
  --header-height: 80px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body.kr-body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Algemene Links */
a {
  color: var(--kr-gold);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover, a:focus {
  color: #ffce66; /* Iets lichtere goudtint */
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- 2. LAYOUT & GRID --- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 16px;
}

.site-main {
  padding: 16px 0 24px;
  min-height: 60vh;
}

/* Hoofdgrid: Links video, Rechts chat */
.live-wrap {
  margin-top: 8px;
}

.live-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: flex-start;
}

/* --- 3. HEADER & MENU --- */
.site-header {
  border-bottom: 4px solid var(--kr-gold);
  background: linear-gradient(90deg, var(--kr-blue) 0%, var(--kr-blue-2) 100%);
  color: #fff;
  position: relative;
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.brand-logo img {
  max-height: 56px;
  width: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.site-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.site-title:hover {
  color: var(--kr-gray);
}

.site-tagline {
  margin: 0;
  font-size: 0.8rem;
  color: var(--kr-gray);
  font-weight: 400;
}

/* Desktop Navigatie */
.site-nav .menu {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.site-nav .menu li a {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #f8fbff;
  transition: background 0.2s ease;
}

.site-nav .menu li a:hover,
.site-nav .menu li.current-menu-item > a {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* Mobiele Navigatie Toggle (Hamburger) */
.nav-toggle {
  display: none; /* Verborgen op desktop */
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav-toggle:hover {
  background: rgba(255,255,255,0.1);
}

.nav-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* --- 4. CONTENT ELEMENTEN (Video, Guards, etc) --- */

/* Video Player Wrapper */
.player {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* De video iframe container (zorgt voor 16:9 verhouding) */
.responsive-video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  padding-top: 0;
  height: 0;
  overflow: hidden;
}

.responsive-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-placeholder {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
  background: var(--card);
}

.player-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(11, 21, 34, 0.9);
  border-top: 1px solid rgba(255,255,255,0.05);
}

.cast-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.2);
  color: #fff;
  font-size: 0.85rem;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.cast-btn:hover {
  background: var(--kr-blue-2);
  border-color: var(--kr-blue-2);
}

/* Toegangskaart (Blocked User) */
.live-guard-card {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 20px 24px;
  margin-top: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.live-guard-card h1 {
  margin: 0 0 10px;
  font-size: 1.5rem;
  color: #fff;
}

.live-guard-card p {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 1rem;
}

/* Gast melding */
.guest-notice {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px dashed var(--kr-gold);
  background: rgba(186,146,45,0.08);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Chat container voor sidebar */
.chat-card {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 400px;
  /* overflow hidden nodig voor border-radius */
  overflow: hidden; 
}

.chat-header {
  background: rgba(0,0,0,0.2);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--kr-gold);
}

.chat-body {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* --- 5. MOBIEL SPECIFIEK (FAB & Overlay) --- */

/* Floating Action Button (Chat openen op mobiel) */
.chat-fab {
  display: none; /* Default uit */
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2000;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 50px;
  border: none;
  background: var(--kr-blue-2);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  transition: transform 0.2s;
}

.chat-fab:hover {
  transform: scale(1.05);
  background: #3b82f6;
}

/* Mobiele Overlay */
.chat-overlay {
  position: fixed;
  inset: 0; /* top/right/bottom/left 0 */
  background: rgba(0,0,0,0.8);
  z-index: 2100;
  display: none; /* Default hidden */
}

/* Als chat actief is, wordt deze display block via JS of :target */
.chat-overlay.is-visible {
  display: block;
}

.chat-overlay-inner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80vh;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  border-top: 3px solid var(--kr-gold);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
}

.chat-overlay-header {
  padding: 15px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-overlay-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.chat-close {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* --- 6. FOOTER --- */
.site-footer {
  margin-top: 40px;
  border-top: 4px solid var(--kr-gold);
  background: var(--kr-blue);
  color: #fff;
}

.footer-widgets {
  max-width: var(--container-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 30px 16px;
}

.footer-widgets h3 {
    color: var(--kr-gold);
    font-size: 1.1rem;
    margin-top: 0;
}

.footer-meta {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 15px 0;
  text-align: center;
  font-size: 0.85rem;
  color: #a3b3c2;
  background: rgba(0,0,0,0.1);
}

/* --- 7. MEDIA QUERIES (RESPONSIVE) --- */

@media (max-width: 900px) {
  /* Op tablet gaan we naar 1 kolom onder elkaar */
  .live-grid {
    grid-template-columns: 1fr;
  }
  
  /* De chat kolom rechts verbergen we standaard op mobiel/tablet 
     We tonen dan de zwevende knop */
  .chat-col {
    display: none;
  }
  
  .chat-fab {
    display: flex; /* Toon zwevende knop */
  }
}

@media (max-width: 768px) {
  /* Header aanpassingen */
  .nav-toggle {
    display: flex; /* Toon hamburger */
  }

  /* Navigatie menu logic */
  .site-nav {
    display: none; /* Verberg standaard */
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--kr-blue);
    border-top: 1px solid var(--kr-blue-2);
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    z-index: 999;
  }
  
  /* De 'is-open' class wordt toegevoegd via main.js */
  .site-nav.is-open {
    display: block;
    animation: menuFadeIn 0.2s ease-out;
  }

  .site-nav .menu {
    flex-direction: column;
    width: 100%;
    align-items: center;
    gap: 15px;
  }
  
  .site-nav .menu li a {
    display: block;
    width: 100%;
    text-align: center;
  }
  
  .header-inner {
    flex-wrap: wrap; 
  }
}

@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 8. WORDPRESS UTILS --- */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}