/*
 * Hyperdope Utility CSS
 * Build-as-you-go utility classes inspired by Tailwind + shadcn/ui
 * Sovereign, self-hosted, zero dependencies
 */

/* ========================================
   CSS VARIABLES - Hyperdope Brand Colors
   ======================================== */
:root {
  /* Brand Colors - New Blue-Based Palette */
  --hyperdope-blue-light: #9bd9fb;      /* Primary base color */
  --hyperdope-blue-medium: #469adc;     /* Secondary actions, hover states */
  --hyperdope-blue-bright: #4288fa;     /* Alternative secondary, active states */
  --hyperdope-yellow: #fcf136;          /* Lightning payments */
  --hyperdope-orange: #ff6600;          /* On-chain bitcoin, legacy branding */
  --hyperdope-orange-hover: #e65c00;
  --hyperdope-green: #6bff71;           /* Success states */
  --hyperdope-purple-light: #ba6ff8;    /* Tertiary accents (minimal use) */
  --hyperdope-purple-dark: #9942f9;     /* Alternative tertiary (minimal use) */

  /* Neutral Grays */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Semantic Colors */
  --success: var(--hyperdope-green);
  --error: #ef4444;
  --warning: #f59e0b;
  --info: var(--hyperdope-blue-medium);

  /* Spacing Scale (rem) */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ========================================
   LAYOUT - Flexbox & Grid
   ======================================== */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Flex Direction */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }

/* Flex Wrap */
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

/* Justify Content */
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

/* Align Items */
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }

/* Gap */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* ========================================
   SPACING - Padding & Margin
   ======================================== */
/* Padding - All Sides */
.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* Padding - Horizontal (left + right) */
.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-5 { padding-left: var(--space-5); padding-right: var(--space-5); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }

/* Padding - Vertical (top + bottom) */
.py-1 { padding-top: var(--space-1); padding-bottom: var(--space-1); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

/* Margin - All Sides */
.m-0 { margin: 0; }
.m-2 { margin: var(--space-2); }
.m-4 { margin: var(--space-4); }
.m-auto { margin: auto; }

/* Margin - Horizontal */
.mx-auto { margin-left: auto; margin-right: auto; }
.mx-2 { margin-left: var(--space-2); margin-right: var(--space-2); }
.mx-4 { margin-left: var(--space-4); margin-right: var(--space-4); }

/* Margin - Vertical */
.my-2 { margin-top: var(--space-2); margin-bottom: var(--space-2); }
.my-4 { margin-top: var(--space-4); margin-bottom: var(--space-4); }

/* Margin - Individual Sides */
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.ml-2 { margin-left: var(--space-2); }
.mr-2 { margin-right: var(--space-2); }

/* ========================================
   COLORS - Backgrounds & Text
   ======================================== */
/* Background Colors */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: var(--gray-50); }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-gray-200 { background-color: var(--gray-200); }
.bg-gray-700 { background-color: var(--gray-700); }
.bg-gray-800 { background-color: var(--gray-800); }
.bg-blue-light { background-color: var(--hyperdope-blue-light); }
.bg-blue-medium { background-color: var(--hyperdope-blue-medium); }
.bg-blue-bright { background-color: var(--hyperdope-blue-bright); }
.bg-orange { background-color: var(--hyperdope-orange); }
.bg-yellow { background-color: var(--hyperdope-yellow); }
.bg-green { background-color: var(--hyperdope-green); }
.bg-transparent { background-color: transparent; }

/* Text Colors */
.text-white { color: #ffffff; }
.text-gray-400 { color: var(--gray-400); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-900 { color: var(--gray-900); }
.text-blue-medium { color: var(--hyperdope-blue-medium); }
.text-blue-bright { color: var(--hyperdope-blue-bright); }
.text-orange { color: var(--hyperdope-orange); }
.text-yellow { color: var(--hyperdope-yellow); }

/* Hover States */
.hover\:bg-gray-100:hover { background-color: var(--gray-100); }
.hover\:bg-gray-200:hover { background-color: var(--gray-200); }
.hover\:bg-blue-medium:hover { background-color: var(--hyperdope-blue-medium); }
.hover\:bg-orange-hover:hover { background-color: var(--hyperdope-orange-hover); }
.hover\:text-white:hover { color: #ffffff; }
.hover\:text-orange:hover { color: var(--hyperdope-orange); }
.hover\:text-blue-medium:hover { color: var(--hyperdope-blue-medium); }

/* ========================================
   TYPOGRAPHY
   ======================================== */
/* Font Size */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }

/* Font Weight */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Text Align */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Line Height */
.leading-tight { line-height: 1.25; }
.leading-normal { line-height: 1.5; }
.leading-relaxed { line-height: 1.625; }

/* ========================================
   BORDERS
   ======================================== */
/* Border Width */
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-0 { border-width: 0; }

/* Border Style */
.border-solid { border-style: solid; }

/* Border Color */
.border-gray-200 { border-color: var(--gray-200); }
.border-gray-300 { border-color: var(--gray-300); }
.border-orange { border-color: var(--hyperdope-orange); }

/* Border Radius */
.rounded-none { border-radius: 0; }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ========================================
   SHADOWS
   ======================================== */
.shadow-none { box-shadow: none; }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* ========================================
   SIZING
   ======================================== */
/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-fit { width: fit-content; }
.w-8 { width: var(--space-8); }  /* 32px */
.w-9 { width: 2.25rem; }          /* 36px */

/* Max Width */
.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-full { max-width: 100%; }

/* Height */
.h-full { height: 100%; }
.h-auto { height: auto; }
.h-8 { height: var(--space-8); }  /* 32px */
.h-9 { height: 2.25rem; }          /* 36px */

/* ========================================
   POSITIONING
   ======================================== */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Z-Index */
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* ========================================
   TRANSITIONS & ANIMATIONS
   ======================================== */
.transition {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

/* ========================================
   EFFECTS
   ======================================== */
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }

/* ========================================
   INTERACTIVE STATES
   ======================================== */
.hover\:shadow-md:hover { box-shadow: var(--shadow-md); }
.hover\:scale-105:hover { transform: scale(1.05); }

.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--hyperdope-orange);
}

.disabled\:opacity-50:disabled { opacity: 0.5; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }

/* ========================================
   COMPONENT PATTERNS (shadcn-inspired)
   ======================================== */

/* Button Base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition-property: all;
  transition-duration: 150ms;
  border: none;
  outline: none;
}

.btn:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--hyperdope-orange);
}

/* Button Variants */
.btn-primary {
  background-color: var(--hyperdope-orange);
  color: white;
}

.btn-primary:hover {
  background-color: var(--hyperdope-orange-hover);
}

.btn-secondary {
  background-color: var(--gray-100);
  color: var(--gray-900);
}

.btn-secondary:hover {
  background-color: var(--gray-200);
}

.btn-ghost {
  background-color: transparent;
  color: var(--gray-700);
}

.btn-ghost:hover {
  background-color: var(--gray-100);
}

/* Card */
.card {
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-4);
}

/* Dropdown/Select */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background-color: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 150ms;
  white-space: nowrap;
}

.dropdown-trigger:hover {
  border-color: var(--gray-400);
  background-color: var(--gray-50);
}

.dropdown-content {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 12rem;
  background-color: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-1);
  z-index: 50;
  display: none;
}

.dropdown-content.open {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 150ms;
  font-size: 0.875rem;
}

.dropdown-item:hover {
  background-color: var(--gray-100);
}

.dropdown-item.active {
  background-color: var(--gray-100);
  color: var(--hyperdope-orange);
  font-weight: 500;
}

/* Filter Toggle Buttons */
.filter-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 150ms;
  color: var(--gray-700);
}

.filter-toggle-btn:hover {
  border-color: var(--gray-400);
  background-color: var(--gray-50);
}

.filter-toggle-btn.active {
  background-color: var(--hyperdope-yellow);
  border-color: var(--hyperdope-yellow);
  color: var(--gray-900);
  font-weight: 500;
}

.filter-toggle-btn .filter-icon {
  font-size: 1rem;
  line-height: 1;
}

.filter-toggle-btn .filter-label {
  white-space: nowrap;
}

/* Filter Groups */
.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid var(--gray-300);
}

.filter-group-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.filter-buttons-horizontal {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Desktop padding for filter bar and search results */
@media (min-width: 769px) {
  #search-filter-bar {
    padding-left: 5%;
    padding-right: 5%;
  }

  .search-results {
    padding-left: 5%;
    padding-right: 5%;
  }

  .player-sidebar {
    padding-left: 0;
    padding-right: 0;
  }
}

/* Medium screens - hide labels and sat amount to save space */
@media (max-width: 1280px) {
  .sats-amount {
    display: none;
  }

  .filter-group-label {
    display: none;
  }
}

/* Mobile - use full width with minimal padding */
@media (max-width: 768px) {
  #search-filter-bar {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .search-results, .player-sidebar {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Simplify button text on mobile */
  .button-text {
    display: none;
  }

  /* Show just "sats" for the With sats button */
  [data-price="low"]::after {
    content: "sats";
  }
}

/* Hide duration filter at smaller breakpoints */
@media (max-width: 1024px) {
  #duration-filter-group {
    display: none;
  }
}

/* Mobile filter layout - keep on same line with vertical separator */
@media (max-width: 768px) {
  #search-filter-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Add vertical line back between sort and watch filters */
  #watch-filter-group {
    border-left: 1px solid var(--gray-300);
    padding-left: 0.75rem;
  }
}

/* Profile Dropdown */
.profile-dropdown-modern.active,
.profile-dropdown-modern:not(.hidden) {
  display: block;
}

.profile-tab-modern {
  color: var(--gray-600);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
}

.profile-tab-modern:hover {
  background-color: var(--gray-100);
}

.profile-tab-modern.active {
  color: var(--hyperdope-blue-medium);
  background: white;
  border-bottom-color: var(--hyperdope-blue-medium);
}

/* Profile Video Items */
.profile-video-item {
  display: flex;
  padding: 10px;
  margin-bottom: 8px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  transition: all 150ms;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.profile-video-item:hover {
  background: var(--gray-100);
  transform: translateX(4px);
}

.profile-video-thumb {
  width: 120px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--gray-200);
}

.profile-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-video-info {
  flex: 1;
  margin-left: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-video-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-900);
  line-height: 1.3;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.profile-video-meta {
  font-size: 0.75rem;
  color: var(--gray-600);
}

.profile-video-expires {
  font-size: 0.75rem;
  color: var(--hyperdope-orange);
  font-weight: 500;
}
