/* ============================================ */
/* UNIFIED COMPONENTS - PREMIUM UI/UX          */
/* Carousels, Accordions, Category Pills       */
/* ============================================ */

/* ============================================ */
/* UNIVERSAL CAROUSEL COMPONENT                */
/* ============================================ */

.u-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.u-carousel-container {
  position: relative;
  display: flex;
  align-items: center;
}

.u-carousel-track {
  display: flex;
  gap: 12px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.u-carousel-track.no-transition {
  transition: none;
}

.u-carousel-item {
  flex-shrink: 0;
  min-width: 280px;
}

/* Carousel Navigation Arrows */
.u-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: 50%;
  color: #00D4FF;
  font-size: 16px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.u-carousel-nav:hover {
  background: rgba(0, 212, 255, 0.2);
  border-color: #00D4FF;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
  transform: translateY(-50%) scale(1.1);
}

.u-carousel-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.u-carousel-nav.prev {
  left: 4px;
}

.u-carousel-nav.next {
  right: 4px;
}

.u-carousel-nav svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}

/* Carousel Pagination Dots */
.u-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 0;
}

.u-carousel-dot {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.u-carousel-dot:hover {
  background: rgba(0, 212, 255, 0.4);
  border-color: rgba(0, 212, 255, 0.6);
}

.u-carousel-dot.active {
  background: #00D4FF;
  border-color: #00D4FF;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
  transform: scale(1.2);
}

/* Carousel Scroll Indicator (for swipe) */
.u-carousel-scroll-hint {
  display: none;
  text-align: center;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 8px;
}

@media (max-width: 768px) {
  .u-carousel-scroll-hint {
    display: block;
  }
  
  .u-carousel-nav {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .u-carousel-item {
    min-width: 260px;
  }
}

/* ============================================ */
/* ACCORDION COMPONENT                          */
/* ============================================ */

.u-accordion {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(20, 20, 20, 0.8);
}

.u-accordion-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.u-accordion-item:last-child {
  border-bottom: none;
}

.u-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: transparent;
  border: none;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #fff;
  text-align: left;
}

.u-accordion-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.u-accordion-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.u-accordion-title .icon {
  font-size: 16px;
}

.u-accordion-arrow {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.3s ease, color 0.2s ease;
}

.u-accordion-arrow svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.u-accordion-item.open .u-accordion-arrow {
  transform: rotate(180deg);
  color: #00D4FF;
}

.u-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.u-accordion-item.open .u-accordion-content {
  max-height: 2000px;
}

.u-accordion-body {
  padding: 0 16px 16px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.6;
}

/* Accordion Variants */
.u-accordion.compact .u-accordion-header {
  padding: 10px 14px;
}

.u-accordion.compact .u-accordion-title {
  font-size: 13px;
}

.u-accordion.glow .u-accordion-item.open {
  background: rgba(0, 212, 255, 0.05);
  box-shadow: inset 0 0 20px rgba(0, 212, 255, 0.05);
}

/* ============================================ */
/* CATEGORY PILLS / TOGGLE BUTTONS             */
/* ============================================ */

.u-category-pills {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.u-category-pills::-webkit-scrollbar {
  display: none;
}

.u-category-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.u-category-pill:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: rgba(0, 212, 255, 0.4);
  color: #00D4FF;
}

.u-category-pill.active {
  background: rgba(0, 212, 255, 0.2);
  border-color: #00D4FF;
  color: #00D4FF;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* Category Pills Variants */
.u-category-pills.compact .u-category-pill {
  padding: 6px 12px;
  font-size: 11px;
}

.u-category-pills.centered {
  justify-content: center;
}

/* ============================================ */
/* SECTION CONTAINER (Collapsible Wrapper)     */
/* ============================================ */

.u-section {
  background: rgba(20, 20, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.u-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.u-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.u-section-title .icon {
  font-size: 16px;
}

.u-section-badge {
  padding: 4px 8px;
  background: rgba(0, 212, 255, 0.15);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #00D4FF;
}

.u-section-content {
  padding: 12px;
}

/* ============================================ */
/* HORIZONTAL SCROLL CONTAINER                 */
/* ============================================ */

.u-h-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.u-h-scroll::-webkit-scrollbar {
  display: none;
}

.u-h-scroll > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* ============================================ */
/* NEWS CARD (For Carousel)                    */
/* ============================================ */

.u-news-card {
  width: 280px;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.u-news-card:hover {
  background: rgba(30, 30, 30, 0.9);
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.u-news-source {
  font-size: 10px;
  font-weight: 700;
  color: #00D4FF;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.u-news-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.u-news-meta {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
}

/* ============================================ */
/* COIN CARD (For Category Carousel)           */
/* ============================================ */

.u-coin-card {
  width: 160px;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.u-coin-card:hover {
  background: rgba(30, 30, 30, 0.9);
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.u-coin-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 8px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.u-coin-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.u-coin-ticker {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
}

.u-coin-price {
  font-size: 11px;
  font-weight: 600;
  color: #39FF14;
  margin-top: 6px;
}

/* ============================================ */
/* STATS ROW (Bento-style inline stats)        */
/* ============================================ */

.u-stats-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.u-stat-box {
  flex: 1;
  min-width: 120px;
  background: rgba(20, 20, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.u-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.u-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.u-stat-value.positive {
  color: #39FF14;
}

.u-stat-value.negative {
  color: #ff4444;
}

/* ============================================ */
/* COLLAPSIBLE FORM                            */
/* ============================================ */

.u-collapsible-form {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(20, 20, 20, 0.6);
}

.u-collapsible-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.u-collapsible-form-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.u-collapsible-form-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.u-collapsible-form-arrow {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.3s ease;
}

.u-collapsible-form-arrow svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.u-collapsible-form.open .u-collapsible-form-arrow {
  transform: rotate(180deg);
  color: #00D4FF;
}

.u-collapsible-form-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.u-collapsible-form.open .u-collapsible-form-content {
  max-height: 1000px;
}

.u-collapsible-form-body {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================ */
/* RESPONSIVE ADJUSTMENTS                       */
/* ============================================ */

@media (max-width: 480px) {
  .u-section-header {
    padding: 10px 12px;
  }
  
  .u-section-title {
    font-size: 13px;
  }
  
  .u-section-content {
    padding: 10px;
  }
  
  .u-news-card {
    width: 240px;
  }
  
  .u-coin-card {
    width: 140px;
  }
  
  .u-stats-row {
    gap: 8px;
  }
  
  .u-stat-box {
    min-width: 100px;
    padding: 10px;
  }
  
  .u-stat-value {
    font-size: 16px;
  }
}
