@font-face {
  font-family: 'PortoSync';
  src: url('PlusJakartaSans-Bold.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'PortoSyncMedium';
  src: url('PlusJakartaSans-ExtraBold.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'PortoSyncNumber';
  src: url('PlusJakartaSans-BoldItalic.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* ===== GLOBAL ===== */
* {
  font-family: 'PortoSync', sans-serif !important;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  color: #fff;
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: fadeIn 0.8s ease-in-out forwards;
  opacity: 0;
}

/* ===== BACKGROUND DESKTOP (default) ===== */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url("craciun/desktop.png") no-repeat center center / cover;
  z-index: -1;
  pointer-events: none;
}

/* ===== BACKGROUND MOBIL / iPHONE ===== */
@media (max-width: 768px) {
  body::before {
    background: url("craciun/mobile.png") no-repeat center center / cover;
  }
}

/* ===== FIX SPECIAL PENTRU iPHONE (Safari) ===== */
@supports (-webkit-touch-callout: none) {
  body::before {
    background: url("craciun/mobile.png") no-repeat center center / cover !important;
  }
}

/* ===== LOGIN ===== */

#loginPage {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  min-height: 100dvh;
}

#loginBox {
  position: relative;
  z-index: 1;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.4), rgba(255,255,255,0.08)),
    radial-gradient(circle at top left, rgba(255,255,255,0.6), transparent 65%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.3), transparent 65%);
  backdrop-filter: blur(120px) saturate(250%);
  -webkit-backdrop-filter: blur(120px) saturate(250%);
  border-radius: 50px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 360px;
  text-align: center;
  border: 2.5px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 25px 150px rgba(255,255,255,0.35),
    0 0 80px rgba(255,255,255,0.15) inset,
    0 0 15px rgba(255,255,255,0.2) glow;
  animation: slideUp 0.8s ease-out forwards;
  opacity: 0;
  transform: translateY(30px);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

#loginBox:hover {
  transform: translateY(0) scale(1.05);
  box-shadow:
    0 30px 200px rgba(255,255,255,0.45),
    0 0 120px rgba(255,255,255,0.2) inset,
    0 0 25px rgba(255,255,255,0.25);
}

#loginBox h2 {
  font-family: 'PortoSync', sans-serif;
  font-weight: 900;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: #fff;
  text-shadow: 0 3px 15px rgba(0,0,0,0.35);
}

#loginBox input {
  width: 100%;
  padding: 0.7rem;
  margin: 0.5rem 0;
  border-radius: 12px;
  font-size: 1rem;
  color: #669EF4;
  border: 1.5px solid rgba(255,255,255,0.35);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.3), rgba(255,255,255,0.08)),
    radial-gradient(circle at top left, rgba(255,255,255,0.5), transparent 65%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.2), transparent 65%);
  backdrop-filter: blur(100px) saturate(200%);
  -webkit-backdrop-filter: blur(100px) saturate(200%);
  transition: border-color 0.3s ease, background 0.3s ease;
}

#loginBox input:focus {
  outline: none;
  border-color: #fff;
  background: rgba(255, 255, 255, 0.25);
}

#loginBox button {
  margin-top: 1rem;
  width: 100%;
  padding: 0.7rem;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.45);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.45), rgba(255,255,255,0.1));
  color: #fff;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

#loginBox button:hover {
  background: rgba(255,255,255,0.55);
  transform: scale(1.05);
  box-shadow: 0 10px 35px rgba(255,255,255,0.4);
}

/* ===== ANIMAȚIE ===== */
@keyframes slideUp { 
  from { opacity: 0; transform: translateY(30px); } 
  to { opacity: 1; transform: translateY(0); } 
}

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: transparent;
  border: none;
  flex-wrap: wrap;
}

#logo { height: 40px; }

#search {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.4), rgba(255,255,255,0.08)),
    radial-gradient(circle at top left, rgba(255,255,255,0.6), transparent 65%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.3), transparent 65%);
  border-radius: 20px;
  padding: 0.5rem 1.5rem;
  font-size: 1rem;
  color: #fff; /* textul introdus este alb */
  border: 2px solid rgba(255,255,255,0.45);
  backdrop-filter: blur(120px) saturate(250%);
  -webkit-backdrop-filter: blur(120px) saturate(250%);
  transition: all 0.3s ease;
  flex: 1 1 auto;
  min-width: 120px;
}

#search::placeholder {
  color: rgba(255,255,255,0.7); /* placeholder alb deschis */
}

#search:focus {
  outline: none;
  border-color: rgba(255,255,255,0.7);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.55), rgba(255,255,255,0.15)),
    radial-gradient(circle at top left, rgba(255,255,255,0.7), transparent 65%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.4), transparent 65%);
  color: #fff; /* asigură alb și la focus */
}

/* ===== USER MENU MAX GLASS ===== */
.user-menu,
#userMenu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.user-icon,
.avatar-img {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.4), rgba(255,255,255,0.08)),
    radial-gradient(circle at top left, rgba(255,255,255,0.6), transparent 65%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.3), transparent 65%);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.3rem;
  text-transform: uppercase;
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 20px 80px rgba(255,255,255,0.2),
    0 0 40px rgba(255,255,255,0.1) inset;
}

.user-name,
#userName {
  color: #fff;
  font-weight: bold;
}

.dropdown-menu,
#dropdownMenu {
  position: absolute;
  top: 100%;
  right: 0;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.4), rgba(255,255,255,0.08)),
    radial-gradient(circle at top left, rgba(255,255,255,0.6), transparent 65%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.3), transparent 65%);
  backdrop-filter: blur(120px) saturate(250%);
  -webkit-backdrop-filter: blur(120px) saturate(250%);
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 25px 150px rgba(255,255,255,0.35),
    0 0 80px rgba(255,255,255,0.15) inset,
    0 0 15px rgba(255,255,255,0.2) glow;
  padding: 8px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  animation: panelEnter 0.3s ease forwards;
  opacity: 0;
  transform: translateY(-10px);
}

.dropdown-menu button,
#dropdownMenu button {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 5px 10px;
  text-align: left;
  transition: background 0.3s ease;
}

.dropdown-menu button:hover,
#dropdownMenu button:hover {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.45), rgba(255,255,255,0.1)),
    radial-gradient(circle at top left, rgba(255,255,255,0.6), transparent 65%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.3), transparent 65%);
  backdrop-filter: blur(120px) saturate(250%);
}

/* ===== APP ===== */
#app {
  display: none;
  flex-direction: column;
  height: auto;
  overflow-y: auto;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* ===== CANALE ===== */
.container {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 1rem;
  flex: 1;
  overflow: hidden;
}

@media (min-width: 768px) {
  .container {
    flex-direction: row;
    align-items: flex-start;
  }
  .channel-list {
    max-height: calc(100vh - 170px);
    overflow-y: auto;
  }
}

.channel-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.channel {
  padding: 1rem;
  border-radius: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.4), rgba(255,255,255,0.08)),
    radial-gradient(circle at top left, rgba(255,255,255,0.6), transparent 65%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.3), transparent 65%);
  backdrop-filter: blur(120px) saturate(250%);
  -webkit-backdrop-filter: blur(120px) saturate(250%);
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 20px 80px rgba(255,255,255,0.25),
    0 0 40px rgba(255,255,255,0.1) inset,
    0 0 10px rgba(255,255,255,0.2) glow;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
}

.channel:hover {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.55), rgba(255,255,255,0.15)),
    radial-gradient(circle at top left, rgba(255,255,255,0.7), transparent 65%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.4), transparent 65%);
  transform: scale(1.03);
}

.channel-info {
  display: flex;
  flex-direction: column;
}

.channel-name {
  font-family: 'PortoSyncMedium', sans-serif !important;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.channel-theme {
  font-size: 0.9rem;
  opacity: 0.7;
  color: #fff;
}

.channel-id {
  font-family: 'PortoSyncNumber', sans-serif !important;
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  color: #fff;
  border-radius: 12px;

  background:
    linear-gradient(145deg, rgba(255,255,255,0.4), rgba(255,255,255,0.08)),
    radial-gradient(circle at top left, rgba(255,255,255,0.6), transparent 65%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.3), transparent 65%);
  
  border: 2px solid rgba(255,255,255,0.45);
  
  backdrop-filter: blur(120px) saturate(250%);
  -webkit-backdrop-filter: blur(120px) saturate(250%);
  
  box-shadow:
    0 10px 40px rgba(255,255,255,0.2),
    0 0 20px rgba(255,255,255,0.1) inset;
  
  transition: all 0.3s ease;
}

/* ===== PLAYER ===== */
.player-section {
  flex: 2;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

video, audio {
  max-width: 100%;
  border-radius: 20px;
}

/* ===== DESCRIERE CANAL ===== */

#channelDescription {
  font-family: 'PortoSyncMedium', sans-serif !important;
  margin-top: -0.5rem;
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: 0.95rem;
  color: #fff;

  background:
    linear-gradient(145deg, rgba(255,255,255,0.4), rgba(255,255,255,0.08)),
    radial-gradient(circle at top left, rgba(255,255,255,0.6), transparent 65%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.3), transparent 65%);
  
  border-radius: 24px;
  border: 2px solid rgba(255,255,255,0.45);

  backdrop-filter: blur(120px) saturate(250%);
  -webkit-backdrop-filter: blur(120px) saturate(250%);
  
  box-shadow:
    0 20px 80px rgba(255,255,255,0.25),
    0 0 40px rgba(255,255,255,0.1) inset,
    0 0 10px rgba(255,255,255,0.2) glow;

  max-width: 100%;
  overflow-wrap: break-word;
  transition: all 0.3s ease;
}

/* ===== EPG ===== */
.epg-container {
  padding: 10px;
  border-radius: 16px;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  text-align: center;
  margin-bottom: 5px;
}

/* ===== MOBILE FOOTER ===== */
.mobile-footer {
  display: none;
}

#passwordModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-box {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.20), rgba(255,255,255,0.05)),
    radial-gradient(circle at top left, rgba(255,255,255,0.35), transparent 80%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.12), transparent 80%);
  backdrop-filter: blur(45px) saturate(160%);
  -webkit-backdrop-filter: blur(45px) saturate(160%);
  padding: 2rem;
  border-radius: 24px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 48px rgba(255,255,255,0.12);
  animation: slideUp 0.6s ease-out forwards;
  opacity: 0;
  transform: translateY(30px);
}

.modal-box h2 {
  margin-bottom: 1rem;
  font-size: 1.4rem;
  font-weight: bold;
  color: #fff;
}

.password-container {
  position: relative;
  width: 100%;
}

.password-container input {
  width: 100%;
  padding: 0.7rem 2.5rem 0.7rem 0.7rem;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255,0.35);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.20), rgba(255,255,255,0.05)),
    radial-gradient(circle at top left, rgba(255,255,255,0.35), transparent 80%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.12), transparent 80%);
  backdrop-filter: blur(45px) saturate(160%);
  -webkit-backdrop-filter: blur(45px) saturate(160%);
  color: #fff;
  font-size: 1rem;
}

.password-container input::placeholder { color: #ddd; }

.password-container button {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  color: #fff;
  font-size: 1rem;
  transition: background 0.3s ease;
}

.password-container button:hover {
  background: rgba(255,255,255,0.3);
}

.modal-box button {
  margin-top: 1rem;
  width: 100%;
  padding: 0.7rem;
  border-radius: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.20), rgba(255,255,255,0.05)),
    radial-gradient(circle at top left, rgba(255,255,255,0.35), transparent 80%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.12), transparent 80%);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.modal-box button:hover {
  background: rgba(255, 255, 255,0.3);
  border-color: rgba(255, 255, 255,0.6);
}

#channelPasswordError {
  display: none;
  margin-top: 0.8rem;
  color: #fff;
  font-weight: 600;
}

@media (max-width: 768px) {
  .channel-list { overflow-y: visible; height: auto; }

  #loginPage {
    padding: 2rem 1rem;
    align-items: center;
    justify-content: center;
    min-height: 100dvh; /* 🔹 centrare reală pe mobile */
  }

  .mobile-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: fixed;
    bottom: 0;
    width: 100%;
    background: none !important;
    padding: 0.5rem;
  }

  .mobile-footer img { width: 100%; max-width: 868px; height: auto; margin-bottom: 0; }
}

.subscription-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.subscription-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid #fff;
  background: transparent;
  color: #fff;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: 0.3s;
}

.subscription-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* ===== SCROLLBAR ===== */

.channel-list::-webkit-scrollbar {
  width: 8px;
}

.channel-list::-webkit-scrollbar-thumb {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.5), rgba(255,255,255,0.2));
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(8px) saturate(150%);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
}

.channel-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
}

.footer {
    text-align: center;
    margin: 40px 0;
    font-size: 1rem;
  }

/* ===== ANIMAȚII ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes panelEnter { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
