/* Filter container base */
.filter {
	background: #272727;
    padding: 20px;
}
.light .filter {
	background: #d3d3d3;
}
.light .filter-group label, .light .available label, .light .channel-modal .modal-close {
    color: #171c24;
}
.light #filterCountry, .light #filterLanguage, .light #filterGenre, .light #filterCountry option, .light #filterLanguage option, .light #filterGenre option {
  background-color: #e7e7e7;
}
.light .grid-item, .light .notice-box {
  background: #bfbfbf;
}
.light .channel-modal .modal-content {
  background: #fff;
  color: #333;
}
.light .channel-disclaimer .note{
    border-top: 1px solid #d5d5d5;
}
.light .grid-item:hover {
  background: #898989;
}
.source-switch input[type="radio"] {
  accent-color: #1ed760; /* Modern way to change radio color when checked */
}

.source-switch input[type="radio"]:checked + span {
  color: #1ed760; /* Change label text color when selected */
}

/* Filters row base */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex-grow: 1;
}

.filter-group {
  flex: 1 1 150px;
  min-width: 150px;
}

.filter-group label {
  display: block;
  margin-bottom: 5px;
  color: #fff;
}

.filters select,
.filters input[type="text"] {
  padding: 5px;
  width: 100%;
}

/* Source switch styling */
.source-switch {
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.source-switch label, .available label {
  margin-right: 20px;
  color: white;
}

#filterCountry, #filterLanguage, #filterGenre {
  background-color: #333;
  color: #1ed760;
  border: 1px solid #1ed760;
  padding: 5px 10px;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

#filterCountry option, #filterLanguage option, #filterGenre option {
  background-color: #333;
  color: #1ed760;
}

/* Change border color on focus */
#filterCountry:focus, #filterLanguage:focus, #filterGenre:focus {
  outline: none;
  border-color: #1ed760; /* Green border on focus */
  box-shadow: 0 0 3px #1ed760;
}

/* Grid container */
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  align-items: flex-start;
}

/* Grid item default styles */
.grid-item {
  background: #434343;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  color: #fff;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.grid-item img {
  width: 100%;
  border-radius: 8px;
  display: block;
  border: 1px solid #1ed760;
}
/* Text hover color */
.grid-item:hover img {
  border: transparent;
}
/* Paragraph text inside grid items */
.grid-item p {
  margin: 8px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
  font-size: 12px;
}

/* Hover effect */
.grid-item:hover {
  background: #5c5c5c;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Paragraph text */
.grid-item p {
  margin: 8px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  transition: color 0.3s ease;
}

/* Text hover color */
.grid-item:hover p {
  color: #1ed760;
}

/* Modal Overlay */
.channel-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  overflow: auto;
  padding: 20px;
}

/* Modal Content Box */
.channel-modal .modal-content {
  position: relative;
  background: #333;
  color: #fff;
  padding: 30px;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.3s ease-in-out;
  font-family: Arial, sans-serif;
}

/* Modal Header */
.channel-modal .modal-content h2 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 24px;
  padding-bottom: 10px;
}

/* Close Button (Circle Style) */
.channel-modal .modal-close {
  position: absolute;
  top: -15px;
  right: -15px;
  background-color: #ff3b3b;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  text-align: center;
  line-height: 32px;
  font-size: 20px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.channel-modal .modal-close:hover {
  background-color: #e60000;
}

/* Prevent background scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

#modalImage {
	max-width: 100%;
	border-radius: 8px;
	border: 2px solid #1ed760;
}

/* Smooth fade-in animation */
@keyframes fadeIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Responsive grid layout */

/* Small screens: 5 items per row */
@media (max-width: 599px) {
  .grid-item {
    width: calc((100% - 4 * 10px) / 5); /* 5 items with 4 gaps */
  }

  .filter-container {
    flex-direction: column;
    gap: 10px;
  }

  .filters {
    flex-direction: column;
    gap: 10px;
  }

  .filter-group {
    width: 100%;
	flex: none;
  }

  .source-switch {
    flex-direction: column;
    margin-bottom: 0;
  }
}

/* Medium screens: 8 items per row */
@media (min-width: 600px) and (max-width: 899px) {
  .grid-item {
    width: calc((100% - 7 * 10px) / 8);
  }

  .filter-container {
    flex-direction: column;
    gap: 10px;
  }

  .filters {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .filter-group {
    flex: 1 1 150px;
  }

  .source-switch {
    flex-direction: row;
    margin-bottom: 0;
  }
}

/* Large screens: 10 items per row */
@media (min-width: 900px) {
  .grid-item {
    width: calc((100% - 9 * 10px) / 10);
  }

  .filter-container,
  .filters,
  .source-switch {
    flex-direction: row;
    gap: 10px;
  }
}
#loadMore {
  background: #1ed760;
  color: #000;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.notice-box {
  background-color: #434343;
  border-left: 5px solid #1ed760;
  margin: 0 0 40px 0;
  padding: 20px;
  border-radius: 10px;
  color: #f1f1f1;
  font-family: Arial, sans-serif;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.notice-box h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: #1ed760;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice-box p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 10px;
}

.notice-box .channel-link {
  color: #1ed760;
  font-weight: bold;
  text-decoration: none;
}

.notice-box .channel-link:hover {
  text-decoration: underline;
}