@font-face {
  font-family: 'PortoSync';
  src: url('SF-Pro-Display-Bold.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'PortoSyncMedium';
  src: url('SF-Pro-Display-Medium.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'PortoSyncNumber';
  src: url('SF-Pro-Display-Light.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

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

body {
  margin: 0;
  padding: 0;
  color: #000;
  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("18yearsd.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("18yearsm.png") no-repeat center center / cover;
  }
}

/* ===== FIX SPECIAL PENTRU iPHONE (NU SE MODIFICĂ) ===== */
@supports (-webkit-touch-callout: none) {
  body::before {
    background: url("18yearsm.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: rgba(0, 0, 0, 0.10);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 50px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 360px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.30);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.10);
  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 4px 30px rgba(0, 0, 0, 0.15);
}

/* TITLU LOGIN */
#loginBox h2 {
  font-family: 'PortoSync', sans-serif !important;
  font-weight: 900;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: #000 !important;
  text-shadow: none;
}

/* INPUTURI */
#loginBox input {
  width: 100%;
  padding: 0.7rem;
  margin: 0.5rem 0;
  border-radius: 12px;
  font-family: 'PortoSync', sans-serif !important;
  font-size: 1rem;
  color: #000 !important;
  border: 1px solid rgba(0, 0, 0, 0.30);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.10);
  background: rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.3s ease, background 0.3s ease;
}

#loginBox input::placeholder {
  color: rgba(0, 0, 0, 0.60) !important;
}

#loginBox input:focus {
  outline: none;
  border-color: rgba(0, 0, 0, 0.70);
  background: rgba(0, 0, 0, 0.08);
  color: #000 !important;
}

/* BUTON LOGIN */
#loginBox button {
  margin-top: 1rem;
  width: 100%;
  padding: 0.7rem;
  font-family: 'PortoSync', sans-serif !important;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.30);
  background: rgba(0, 0, 0, 0.08);
  color: #000 !important;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

#loginBox button:hover {
  background: rgba(0, 0, 0, 0.14);
  color: #000 !important;
  transform: scale(1.05);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

/* TEXT / LABELS DIN LOGIN */
#loginBox label,
#loginBox p,
#loginBox span,
#loginBox a {
  color: #000 !important;
}

/* TEXT MIC / ERORI DIN LOGIN */
#loginBox .error,
#loginBox .message,
#loginBox .status {
  color: #000 !important;
}

/* ===== ANIMAȚIE ===== */

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

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

/* ===== 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: rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  padding: 0.5rem 1.5rem;
  font-size: 1rem;
  color: #000;
  border: 1px solid rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.3s ease;
  flex: 1 1 auto;
  min-width: 120px;
}

#search::placeholder {
  color: rgba(0, 0, 0, 0.60);
}

#search:focus {
  outline: none;
  border-color: rgba(0, 0, 0, 0.70);
  background: rgba(0, 0, 0, 0.10);
  color: #000;
}

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

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

/* ===== 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: rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #000;
  font-weight: 700;
  font-size: 1.3rem;
  text-transform: uppercase;
  border: 1px solid rgba(0, 0, 0, 0.30);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.10);
}

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

.dropdown-menu,
#dropdownMenu {
  position: absolute;
  top: 100%;
  right: 0;
  background: rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.30);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.10);
  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: #000;
  cursor: pointer;
  padding: 5px 10px;
  text-align: left;
  transition: background 0.3s ease;
}

.dropdown-menu button:hover,
#dropdownMenu button:hover {
  background: rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(16px);
}

/* ===== 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: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.30);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.10);
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
}

.channel:hover {
  background: rgba(0, 0, 0, 0.12);
  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: #000;
}

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

.channel-id {
  font-family: 'PortoSyncNumber', sans-serif !important;
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  color: #000;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.10);
  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;
  width: 100%;
}

/* ===== EPG CONTAINER GLASS DESIGN ===== */

.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: rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.20);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-radius: 20px;
  padding: 1rem 1.2rem;
  text-align: left;
  transition: transform 0.3s ease, background 0.3s ease;
  width: 100%;
}

.epg-card:hover {
  background: rgba(0, 0, 0, 0.12);
}

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

.epg-live-indicator {
  background: #000;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 8px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.40);
}

.epg-next-badge {
  background: rgba(0, 0, 0, 0.15);
  color: #000;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
}

.epg-rating {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.40);
  color: #000;
  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: 0.8;
  color: #000;
}

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

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

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

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

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

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

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

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

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

video:fullscreen {
  border-radius: 0 !important;
}

video:-webkit-full-screen {
  border-radius: 0 !important;
}

video:-moz-full-screen {
  border-radius: 0 !important;
}

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: #000;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 24px;
  border: 1px solid rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.10);
  max-width: 100%;
  overflow-wrap: break-word;
  transition: all 0.3s ease;
}

/* ===== 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: rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 2rem;
  border-radius: 24px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.30);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.10);
  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: #000;
}

.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 rgba(0, 0, 0, 0.30);
  background: rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #000;
  font-size: 1rem;
}

.password-container input::placeholder {
  color: rgba(0, 0, 0, 0.55);
}

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

.password-container button:hover {
  background: rgba(0, 0, 0, 0.08);
}

.modal-box button {
  margin-top: 1rem;
  width: 100%;
  padding: 0.7rem;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.30);
  background: rgba(0, 0, 0, 0.08);
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.modal-box button:hover {
  background: rgba(0, 0, 0, 0.14);
  border-color: rgba(0, 0, 0, 0.60);
}

#channelPasswordError {
  display: none;
  margin-top: 0.8rem;
  color: #000;
  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;
  gap: 12px;
  margin: 20px 0;
}

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

.subscription-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

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

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

.channel-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.10);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

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

.footer {
  text-align: center;
  margin: 10px 0 15px 0;
  font-size: 1rem;
  color: #000;
}

.real-id {
  font-size: 10px;
  color: rgba(0, 0, 0, 0.60);
}

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

@media (max-width: 768px) {

  header {
    display: grid;

    grid-template-columns: 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: 18px;
  text-align: center;
  background: rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.20);
}

.discord-card h3 {
  margin: 0 0 6px;
  color: #000;
}

.discord-card p {
  margin: 0 0 15px;
  color: rgba(0, 0, 0, 0.70);
}

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

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

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