/* popup.css - FINAL Fix with visible popup background */

.payment-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.payment-item {
  background-color: #2e2e2e;
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  color: white;
  position: relative;
}

.payment-item:hover {
  background-color: #3c3c3c;
}

@keyframes popupFadeScale {
  from {
    opacity: 0;
    transform: scaleY(0.95);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

.popup-channel-grid {
  background-color: #2f2f2f;
  color: white;
  opacity: 1; /* 🛠️ Fix visibility */
  transform: scaleY(1);
  transform-origin: top;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: none;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  padding: 1rem;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 100%;
  margin-top: 1rem;
}

.popup-channel-grid.active {
  display: grid;
  animation: popupFadeScale 0.15s ease-out forwards;
}

.popup-card {
  background-color: #2d2d2d;
  padding: 1rem;
  border-radius: 0.75rem;
  text-align: center;
  color: white;
  cursor: pointer;
  border: 2px solid transparent;
  transition: 0.1s;
}

.popup-card:hover {
  border-color: gold !important;
  background-color: #383838 !important;
}

.popup-card i {
  font-size: 20px;
  color: gold;
}

.popup-card div:last-child {
  color: #999;
}

.payment-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
  gap: 8px;
  font-weight: bold;
  cursor: pointer;
  color: white;
}

.payment-toggle .arrow-icon {
  transition: transform 0.1s ease;
}

.payment-toggle.active .arrow-icon {
  transform: rotate(180deg);
}

@media (max-width: 1024px) {
  .popup-channel-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .popup-channel-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

.hidden {
  display: none;
}

.show {
  display: flex;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Responsive Adjustments */
@media (max-width: 360px) {
  .flex.items-center.space-x-2 > * {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  #premium-container button,
  #login-container button {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  #popup-premium,
  #popup-login {
    width: 95vw;
    left: 2.5vw;
    right: auto;
  }
}

@media (min-width: 361px) and (max-width: 639px) {
  #popup-premium,
  #popup-login {
    width: 85vw;
    left: 7.5vw;
    right: auto;
  }
}

/* Ensure buttons remain clickable on mobile */
button, .group {
  min-width: fit-content;
  position: relative;
  z-index: 10;
}

/* Mobile touch target sizing */
@media (pointer: coarse) {
  button {
    min-height: 36px;
    min-width: 44px;
  }
}

/* Smooth popup transitions */
#popup-premium,
#popup-login {
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform-origin: top right;
}

.group:hover #popup-premium,
.group:hover #popup-login {
  opacity: 1;
  transform: scale(1);
  display: flex;
}



/* Responsive Header Adjustments */
header {
  position: relative;
}

header .flex.items-center.space-x-4 {
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Search bar adjustments */
header .relative {
  order: 1;
  flex: 1 1 100%;
  max-width: 100%;
  margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
  header .relative {
    order: 0;
    flex: 0 1 auto;
    max-width: 200px;
    margin-bottom: 0;
  }
}

/* Icon buttons */
header .fa-download,
header .fa-clock,
header .fa-bookmark,
header .fa-ellipsis-v {
  font-size: 1rem;
  padding: 0.5rem;
}

/* Main action buttons container */
header .flex.items-center.space-x-2 {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  gap: 0.5rem;
  padding: 0.25rem 0;
}

header .flex.items-center.space-x-2::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Individual buttons */
#premium-container,
#login-container,
header a.inline-block {
  flex-shrink: 0;
}

/* Button text adjustments */
header button span,
header a.inline-block button span {
  white-space: nowrap;
}

/* Button sizes */
header button {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
}

@media (min-width: 480px) {
  header button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

@media (min-width: 768px) {
  header button {
    padding: 0.5rem 1.25rem;
  }
}

/* Icon sizes in buttons */
.icon-navbar {
  width: 1rem;
  height: 1rem;
  margin-right: 0.25rem;
}

@media (min-width: 480px) {
  .icon-navbar {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
  }
}

/* Popup positioning fixes */
#popup-premium,
#popup-login {
  width: calc(100vw - 2rem);
  left: 1rem;
  right: auto;
}

@media (min-width: 640px) {
  #popup-premium,
  #popup-login {
    width: 20rem;
    left: auto;
    right: 0;
  }
}

@media (min-width: 768px) {
  #popup-premium {
    width: 22rem;
  }
  
  #popup-login {
    width: 24rem;
  }
}

/* Hide icons when space is limited */
@media (max-width: 360px) {
  .icon-navbar {
    display: none;
  }
  
  header button {
    padding: 0.5rem;
  }
}

/* Ensure header doesn't wrap on larger screens */
@media (min-width: 1024px) {
  header .flex.items-center.space-x-4 {
    flex-wrap: nowrap;
  }
  
  header .flex.items-center.space-x-2 {
    overflow-x: visible;
  }
}