/* Popup, Video, News components styles */

/* 1. Popup Override: Bottom-right rectangular box without full overlay */
.popup-overlay {
  position: fixed;
  inset: auto;
  bottom: 90px;
  right: 24px;
  background: none;
  z-index: 9999;
  display: block;
  padding: 0;
  pointer-events: none; /* allow clicking behind it */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.popup-content {
  background: #fff;
  width: 340px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,0.2);
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  pointer-events: auto; /* re-enable clicks on the box */
  border: 1px solid rgba(0,0,0,0.05);
}

.popup-overlay.active .popup-content {
  transform: translateY(0);
}

.popup-body {
  padding: 24px 20px 20px;
  text-align: left;
}

.popup-body h3 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.3;
}

.popup-body p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  word-break: keep-all;
}

.popup-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(4px);
  border: none;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  color: var(--text-secondary);
  z-index: 2;
}

.popup-close-btn:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text);
}

.popup-close-btn svg {
  width: 16px;
  height: 16px;
}

.popup-footer {
  display: flex;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.popup-footer label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  border-right: 1px solid var(--line);
  user-select: none;
  margin: 0;
}

.popup-footer input[type="checkbox"] {
  accent-color: var(--cyan);
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}

.popup-footer button {
  flex: 0.6;
  background: transparent;
  border: none;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s;
}

.popup-footer button:hover {
  background: rgba(0,0,0,0.05);
}

/* 2. Video Grid */
.video-grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .video-grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .video-grid-container {
    grid-template-columns: 1fr;
  }
}

.video-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  padding: 0 4px;
  line-height: 1.4;
  word-break: keep-all;
}

/* 3. News Grid */
.news-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.news-card {
  display: block;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: inherit;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.news-date {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 500;
}

.news-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
  line-height: 1.4;
}

.news-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-clamp: 3;
}
