@font-face {
  font-family: 'PortoSync';
  src: url('yovo.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'PortoSyncMedium';
  src: url('yovo.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'PortoSyncNumber';
  src: url('yovo.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

/* ===== GLOBAL ===== */

:root {
  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-bg-hover: rgba(255, 255, 255, 0.20);
  --glass-bg-strong: rgba(255, 255, 255, 0.17);
  --glass-border: rgba(255, 255, 255, 0.35);
  --glass-border-hover: rgba(255, 255, 255, 0.60);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
  --glass-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.23);
  --glass-blur: 24px;
  --text-primary: #fff;
  --text-secondary: rgba(255, 255, 255, 0.78);
}

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

html {
  color-scheme: dark;
}

body {
  margin: 0;
  padding: 0;
  color: var(--text-primary);
  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 — NU SE MODIFICĂ ===== */

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

/* ===== BACKGROUND MOBIL / iPHONE — NU SE MODIFICĂ ===== */

@media (max-width: 768px) {
  body::before {
    background: url("duomobil.png") no-repeat center center / cover;
  }
}

/* ===== FIX SPECIAL PENTRU iPHONE — NU SE MODIFICĂ ===== */

@supports (-webkit-touch-callout: none) {
  body::before {
    background: url("duomobil.png") no-repeat center center / cover !important;
  }
}

/* ===== GLASS GENERAL ===== */

#loginBox,
#loginBox input,
#loginBox button,
#search,
.user-icon,
.avatar-img,
.dropdown-menu,
#dropdownMenu,
.channel,
.channel-id,
.epg-card,
.epg-next-badge,
.epg-rating,
#channelDescription,
.modal-box,
.password-container input,
.modal-box button,
.subscription-btn,
.discord-card {
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
}

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

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

#loginBox {
  position: relative;
  z-index: 1;
  background: var(--glass-bg);
  border-radius: 32px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 360px;
  text-align: center;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  animation: slideUp 0.8s ease-out forwards;
  opacity: 0;
  transform: translateY(30px);
  transition: transform 0.4s ease, box-shadow 0.4s ease,
              background 0.3s ease, border-color 0.3s ease;
}

#loginBox:hover {
  transform: translateY(0) scale(1.025);
  background: var(--glass-bg-strong);
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-shadow-hover);
}

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

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

#loginBox input {
  width: 100%;
  padding: 0.8rem;
  margin: 0.5rem 0;
  border-radius: 14px;
  font-family: 'PortoSync', sans-serif !important;
  font-size: 1rem;
  color: #fff !important;
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.10);
  transition: border-color 0.3s ease, background 0.3s ease,
              box-shadow 0.3s ease;
}

#loginBox input::placeholder {
  color: rgba(255, 255, 255, 0.70) !important;
}

#loginBox input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.80);
  background: rgba(255, 255, 255, 0.17);
  color: #fff !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.09);
}

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

#loginBox button {
  margin-top: 1rem;
  width: 100%;
  padding: 0.8rem;
  font-family: 'PortoSync', sans-serif !important;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.13);
  color: #fff !important;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.10);
  transition: background 0.3s ease, transform 0.2s ease,
              box-shadow 0.3s ease, border-color 0.3s ease;
}

#loginBox button:hover {
  background: rgba(255, 255, 255, 0.24);
  color: #fff !important;
  transform: translateY(-2px);
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-shadow);
}

#loginBox label,
#loginBox p,
#loginBox span,
#loginBox a,
#loginBox .error,
#loginBox .message,
#loginBox .status {
  color: #fff !important;
}

/* ===== ANIMAȚII ===== */

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes panelEnter {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== HEADER ===== */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: transparent;
  border: none;
  flex-wrap: wrap;
}

#logo {
  height: 40px;
}

#search {
  background: var(--glass-bg);
  border-radius: 20px;
  padding: 0.65rem 1.25rem;
  font-size: 1rem;
  color: #fff !important;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: all 0.3s ease;
  flex: 1 1 auto;
  min-width: 120px;
}

#search::placeholder {
  color: rgba(255, 255, 255, 0.70);
}

#search:focus {
  outline: none;
  border-color: var(--glass-border-hover);
  background: var(--glass-bg-strong);
  color: #fff !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

@media (max-width: 768px) {
  header {
    gap: 10px;
  }

  #search {
    margin-right: 8px;
  }
}

/* ===== USER MENU ===== */

.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: var(--glass-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff !important;
  font-weight: 700;
  font-size: 1.3rem;
  text-transform: uppercase;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.user-name,
#userName {
  color: #fff !important;
  font-weight: bold;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}

.dropdown-menu,
#dropdownMenu {
  position: absolute;
  top: 100%;
  right: 0;
  background: rgba(35, 35, 45, 0.45);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-hover);
  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;
  border-radius: 10px;
  color: #fff !important;
  cursor: pointer;
  padding: 8px 12px;
  text-align: left;
  transition: background 0.3s ease;
}

.dropdown-menu button:hover,
#dropdownMenu button:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ===== APP ===== */

#app {
  display: none;
  flex-direction: column;
  height: auto;
  padding-top: 90px;
  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: 0;
  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: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease,
              border-color 0.3s ease, box-shadow 0.3s ease;
}

.channel:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
}

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

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

.channel-theme {
  font-size: 0.9rem;
  opacity: 1;
  color: rgba(255, 255, 255, 0.76) !important;
}

.channel-id {
  font-family: 'PortoSyncNumber', sans-serif !important;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  color: #fff !important;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: all 0.3s ease;
}

/* ===== PLAYER FIX ===== */

.player-section {
  flex: 2;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  overflow: visible !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  width: 100%;
}

/* ===== EPG CONTAINER ===== */

.epg-container {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100%;
  max-width: 800px;
  margin: 1rem auto;
  padding: 0 !important;
  position: relative;
  z-index: 10;
}

.epg-glass-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.epg-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 22px;
  padding: 1rem 1.2rem;
  text-align: left;
  transition: transform 0.3s ease, background 0.3s ease,
              border-color 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
}

.epg-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-shadow-hover);
}

.epg-header-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.epg-live-indicator {
  background: rgba(255, 255, 255, 0.20);
  color: #fff !important;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.30);
  border-radius: 8px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.08);
}

.epg-next-badge {
  background: rgba(255, 255, 255, 0.12);
  color: #fff !important;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
}

.epg-rating {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff !important;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 6px;
}

.epg-time-range {
  font-family: 'PortoSyncNumber', sans-serif !important;
  font-size: 0.85rem;
  opacity: 1;
  color: rgba(255, 255, 255, 0.80) !important;
}

.epg-title {
  font-family: 'PortoSync', sans-serif !important;
  font-size: 1.15rem;
  margin: 0;
  color: #fff !important;
  font-weight: bold;
}

.epg-title-next {
  font-family: 'PortoSyncMedium', sans-serif !important;
  font-size: 1rem;
  margin: 0;
  color: #fff !important;
}

.epg-desc {
  font-family: 'PortoSyncMedium', sans-serif !important;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.78) !important;
  margin: 6px 0 0;
  line-height: 1.45;
}

.epg-badge-off {
  font-size: 0.75rem;
  color: #fff !important;
  font-weight: bold;
}

/* ===== LOADER ===== */

.epg-loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.30);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  margin-right: 8px;
}

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

/* ===== FULLSCREEN FIX ===== */

video:fullscreen,
video:-webkit-full-screen,
video:-moz-full-screen,
video:-ms-fullscreen {
  border-radius: 0 !important;
}

/* ===== 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 !important;
  background: var(--glass-bg);
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  max-width: 100%;
  overflow-wrap: break-word;
  transition: all 0.3s ease;
}

/* ===== MOBILE FOOTER ===== */

.mobile-footer {
  display: none;
}

/* ===== PASSWORD MODAL ===== */

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

.modal-box {
  background: rgba(35, 35, 45, 0.48);
  padding: 2rem;
  border-radius: 26px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-hover);
  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 !important;
}

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

.password-container input {
  width: 100%;
  padding: 0.7rem 2.5rem 0.7rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.10);
  color: #fff !important;
  font-size: 1rem;
}

.password-container input::placeholder {
  color: rgba(255, 255, 255, 0.70) !important;
}

.password-container input:focus {
  outline: none;
  border-color: var(--glass-border-hover);
  background: rgba(255, 255, 255, 0.17);
}

.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 !important;
  font-size: 1rem;
  transition: background 0.3s ease;
}

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

.modal-box button {
  margin-top: 1rem;
  width: 100%;
  padding: 0.7rem;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.13);
  color: #fff !important;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease,
              transform 0.2s ease;
}

.modal-box button:hover {
  background: rgba(255, 255, 255, 0.23);
  border-color: var(--glass-border-hover);
  transform: translateY(-1px);
}

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

/* ===== MOBILE ===== */

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

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

  .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 ===== */

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

.subscription-btn {
  padding: 10px 20px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: #fff !important;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--glass-shadow);
  transition: background 0.3s ease, transform 0.2s ease,
              border-color 0.3s ease, box-shadow 0.3s ease;
}

.subscription-btn:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
}

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

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

.channel-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

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

.footer {
  text-align: center;
  margin: 10px 0 15px;
  font-size: 1rem;
  color: #fff !important;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}

.real-id {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.68) !important;
}

/* ===== MOBILE HEADER LAYOUT ===== */

@media (max-width: 768px) {
  header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "logo logo"
      "search user";
    align-items: center;
    row-gap: 12px;
    column-gap: 10px;
    padding:
      calc(env(safe-area-inset-top, 0px) + 0.8rem)
      1rem
      0.8rem
      1rem;
    flex-wrap: unset;
  }

  #logo {
    grid-area: logo;
    justify-self: center;
    height: 34px;
  }

  #search {
    grid-area: search;
    width: 100%;
    min-width: 0;
    margin-right: 0;
  }

  .user-menu,
  #userMenu {
    grid-area: user;
    justify-self: end;
  }

  #app {
    padding-top: 120px;
  }
}

/* ===== DISCORD ===== */

.discord-widget {
  display: flex;
  justify-content: center;
  margin: 30px auto;
}

.discord-card {
  width: 390px;
  max-width: calc(100% - 30px);
  padding: 20px;
  border-radius: 22px;
  text-align: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.discord-card h3 {
  margin: 0 0 6px;
  color: #fff !important;
}

.discord-card p {
  margin: 0 0 15px;
  color: rgba(255, 255, 255, 0.78) !important;
}

.discord-card iframe {
  width: 350px;
  max-width: 100%;
  border-radius: 12px;
}

/* ===== ACCESSIBILITATE / TEXT ===== */

input,
textarea,
select,
button {
  accent-color: #fff;
}

input,
textarea,
select {
  color: #fff;
}

input:focus-visible,
button:focus-visible,
a:focus-visible,
.subscription-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}

/* ===== GLASS FALLBACK ===== */

@supports not ((backdrop-filter: blur(1px)) or
               (-webkit-backdrop-filter: blur(1px))) {
  #loginBox,
  #loginBox input,
  #loginBox button,
  #search,
  .user-icon,
  .avatar-img,
  .dropdown-menu,
  #dropdownMenu,
  .channel,
  .channel-id,
  .epg-card,
  .epg-next-badge,
  .epg-rating,
  #channelDescription,
  .modal-box,
  .password-container input,
  .modal-box button,
  .subscription-btn,
  .discord-card {
    background: rgba(30, 30, 40, 0.72);
  }
}