/* Content Carousel Styles */

.carousel-container {
  position: fixed;
  top: 15px; /* Moved down from 10px to 15px to further avoid scraping the top edge */
  left: 220px; /* Start even further right to avoid logo collision */
  right: 320px; /* Increased from 300px to 320px to further avoid overlap with auth buttons */
  height: 140px; /* Increased height for more text space */
  z-index: 999;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  align-items: center;
  animation: scroll-left 324s linear infinite; /* 20% faster than before */
  gap: 20px;
}

.carousel-track:hover {
  animation-play-state: paused;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-100%);
  }
}

.carousel-item {
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  opacity: 0.6; /* Start at 60% opacity */
}

.carousel-item:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 191, 255, 0.3);
  opacity: 1; /* Full opacity on hover */
}

/* Layout Option 1: Horizontal cards with image on left, text on right */
.carousel-item.layout-1 {
  width: 280px;
  height: 50px;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border: 1px solid #333;
  display: flex;
  align-items: center;
}

.carousel-item.layout-1 .carousel-image {
  width: 50px;
  height: 50px;
  object-fit: cover;
  flex-shrink: 0;
}

.carousel-item.layout-1 .carousel-content {
  flex: 1;
  padding: 8px 12px;
  overflow: hidden;
}

.carousel-item.layout-1 .carousel-headline {
  font-size: 12px;
  font-weight: 600;
  color: #00bfff;
  line-height: 1.2;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carousel-item.layout-1 .carousel-text {
  font-size: 10px;
  color: #ccc;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Layout Option 2: Vertical cards with image on top, text below */
.carousel-item.layout-2 {
  width: 200px;
  height: 140px; /* Increased height for more text space */
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border: 1px solid #333;
  display: flex;
  flex-direction: column;
}

.carousel-item.layout-2 .carousel-image {
  width: 100%;
  height: 80px; /* Bigger image area */
  object-fit: cover;
  flex-shrink: 0;
}

.carousel-item.layout-2 .carousel-content {
  flex: 1;
  padding: 8px 12px; /* More padding */
  overflow: hidden;
}

.carousel-item.layout-2 .carousel-headline {
  font-size: 12px; /* Smaller font so 3rd row fits completely */
  font-weight: 600;
  color: #00bfff;
  line-height: 1.3;
  white-space: normal; /* Allow wrapping for full headlines */
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 4; /* Show up to 4 lines for more headline space */
  -webkit-box-orient: vertical;
}

.carousel-item.layout-2 .carousel-text {
  font-size: 10px; /* Bigger font */
  color: #ccc;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Show more text */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Layout Option 3: Compact horizontal with overlay text */
.carousel-item.layout-3 {
  width: 240px;
  height: 50px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.carousel-item.layout-3 .carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-item.layout-3 .carousel-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 8px 12px;
}

.carousel-item.layout-3 .carousel-headline {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.carousel-item.layout-3 .carousel-text {
  font-size: 9px;
  color: #ccc;
  line-height: 1.1;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Layout Option 4: Minimalist with icon and text */
.carousel-item.layout-4 {
  width: 220px;
  height: 50px;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border: 1px solid #333;
  display: flex;
  align-items: center;
  padding: 0 12px;
}

.carousel-item.layout-4 .carousel-image {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 10px;
  flex-shrink: 0;
}

.carousel-item.layout-4 .carousel-content {
  flex: 1;
  overflow: hidden;
}

.carousel-item.layout-4 .carousel-headline {
  font-size: 11px;
  font-weight: 600;
  color: #00bfff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.carousel-item.layout-4 .carousel-text {
  font-size: 9px;
  color: #ccc;
  line-height: 1.1;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Content Details Drawer */
.content-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background-color: #1a1a1a;
  border-left: 2px solid #333;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.5);
  transition: right 0.3s ease-in-out;
  z-index: 1001;
  overflow: hidden; /* Changed to hidden since body will handle scrolling */
  display: flex;
  flex-direction: column;
}

.content-drawer.open {
  right: 0;
}

.content-drawer-header {
  padding: 30px 30px 20px 30px;
  border-bottom: 1px solid #333;
  flex-shrink: 0; /* Prevent header from shrinking */
}

.content-drawer-title {
  font-size: 24px;
  font-weight: bold;
  color: #00bfff;
  margin-bottom: 8px;
  line-height: 1.3;
}

.content-drawer-author {
  font-size: 14px;
  color: #888;
  margin-bottom: 15px;
}

.content-drawer-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
}

.content-drawer-close:hover {
  color: #fff;
}

.content-drawer-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0; /* Remove padding since we'll add it to children */
}

/* Media container for video or image - sticky at top */
.content-drawer-media-container {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #1a1a1a;
  padding: 20px 30px 0 30px;
  flex-shrink: 0;
}

.content-drawer-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

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

.content-drawer-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

/* Scrollable content area */
.content-drawer-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 20px 30px 30px 30px;
}

.content-drawer-text {
  line-height: 1.6;
  color: #ddd;
  font-size: 14px;
  margin-bottom: 20px;
  white-space: pre-wrap; /* Preserve formatting */
}

.content-drawer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.content-drawer-tag {
  background-color: #333;
  color: #00bfff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.content-drawer-meta {
  font-size: 12px;
  color: #888;
  border-top: 1px solid #333;
  padding-top: 15px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .carousel-container {
    padding: 0 80px;
  }
  
  .carousel-item.layout-1 {
    width: 240px;
  }
  
  .carousel-item.layout-2 {
    width: 180px;
  }
  
  .carousel-item.layout-3 {
    width: 200px;
  }
  
  .carousel-item.layout-4 {
    width: 200px;
  }
  
  .content-drawer {
    width: 100%;
    right: -100%;
  }
}
