/* ITS App - Minimal Custom Styles for TailwindCSS */

/* Any additional custom styles that TailwindCSS doesn't cover can go here */
/* Currently, all styling is handled by TailwindCSS classes */

/* Chart containers are handled by TailwindCSS and D3.js */
/* All animations are handled by TailwindCSS utility classes */
/* All component styling is handled by TailwindCSS classes */

/* Company Search Styles */
.company-search-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.search-header {
  text-align: center;
  margin-bottom: 2rem;
}

.search-box {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.5rem;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.search-result-item {
  padding: 1rem;
  cursor: pointer;
  border-bottom: 1px solid #374151;
  transition: background-color 0.2s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: #374151;
}

.popular-stocks {
  max-width: 800px;
  margin: 0 auto;
}

.popular-stock-card {
  padding: 1rem;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.popular-stock-card:hover {
  background: #374151;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Company Details Styles */
.company-details-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.back-button {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s;
}

.back-button:hover {
  background: #374151;
}

.company-header {
  animation: fadeIn 0.3s ease-in;
}

.controls-panel {
  animation: fadeIn 0.4s ease-in;
}

.chart-container {
  animation: fadeIn 0.5s ease-in;
  min-height: 500px;
}

.congress-trades-section {
  animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ApexCharts dark theme adjustments */
.apexcharts-canvas {
  background: transparent !important;
}

.apexcharts-tooltip {
  background: #1f2937 !important;
  border: 1px solid #374151 !important;
  color: white !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .company-search-container,
  .company-details-container {
    padding: 1rem 0.5rem;
  }

  .controls-panel .flex {
    flex-direction: column;
    align-items: stretch;
  }

  .controls-panel .flex > div {
    width: 100%;
  }

  .chart-container {
    padding: 1rem;
    min-height: 400px;
  }

  /* Insider Details - Mobile Table Adjustments */
  table th,
  table td {
    padding: 8px !important;
  }

  /* Reduce card padding on mobile */
  .card {
    padding: var(--space-4) !important;
  }

  /* Mobile Navigation Improvements */
  nav {
    position: sticky;
    top: 0;
    z-index: 50;
  }

  /* Ensure mobile menu doesn't interfere with content */
  #mobile-menu {
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 50;
  }

  /* Mobile menu links - increase hit targets */
  #mobile-menu a,
  #mobile-menu button {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Ensure nav bar stays above backdrop */
  nav > div {
    position: relative;
    z-index: 51;
  }
}

/* Small devices - minimum 360px width support */
@media (max-width: 360px) {
  table {
    font-size: 0.75rem;
  }

  table th,
  table td {
    padding: 6px !important;
  }

  /* Adjust nav padding for very small screens */
  nav .max-w-7xl {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Extra small devices - 320px support */
@media (max-width: 320px) {
  /* Compact navigation spacing */
  nav .h-16 {
    height: 3.5rem;
  }

  nav img {
    height: 1.75rem;
  }

  /* Smaller hit targets but still accessible */
  #mobile-menu a,
  #mobile-menu button {
    min-height: 40px;
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
  }
}
/* ===== Smooth Carousel Slide Transition ===== */
/* Professional, polished horizontal slide for stock preview carousel */

.carousel-enter-active,
.carousel-leave-active {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); /* ease-in-out */
}

.carousel-enter-from {
  transform: translateX(30px);
  opacity: 0;
}

.carousel-enter-to {
  transform: translateX(0);
  opacity: 1;
}

.carousel-leave-from {
  transform: translateX(0);
  opacity: 1;
}

.carousel-leave-to {
  transform: translateX(-30px);
  opacity: 0;
}

/* ===== SortableJS Drag-and-Drop Styles ===== */
.sortable-ghost {
  opacity: 0.4;
  background-color: var(--surface-hover);
  border: 2px dashed var(--primary-500);
}

.sortable-drag {
  opacity: 1;
  background-color: var(--surface-raised);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  cursor: grabbing !important;
}

.drag-handle {
  transition: all 0.2s ease;
}

.drag-handle:hover {
  transform: scale(1.1);
}

.drag-handle:active {
  cursor: grabbing;
}

/* ========================================
   SKELETON LOADER STYLES
   ======================================== */

/* Shimmer animation for skeleton loaders - more sophisticated than basic pulse */
.skeleton-shimmer {
  background: linear-gradient(
    90deg,
    var(--surface-hover, #232327) 0%,
    var(--surface-raised, #141416) 50%,
    var(--surface-hover, #232327) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Base skeleton shapes */
.skeleton-box {
  background-color: var(--surface-hover, #232327);
  border-radius: 4px;
}

.skeleton-circle {
  background-color: var(--surface-hover, #232327);
  border-radius: 50%;
}

.skeleton-pill {
  background-color: var(--surface-hover, #232327);
  border-radius: 9999px;
}

/* Skeleton text lines with varying widths */
.skeleton-text-full {
  width: 100%;
  height: 16px;
}

.skeleton-text-3\/4 {
  width: 75%;
  height: 16px;
}

.skeleton-text-1\/2 {
  width: 50%;
  height: 16px;
}

.skeleton-text-1\/3 {
  width: 33.333%;
  height: 16px;
}

.skeleton-text-1\/4 {
  width: 25%;
  height: 16px;
}

/* Chart skeleton with enhanced shimmer */
.skeleton-chart {
  background: linear-gradient(
    90deg,
    var(--surface-hover, #232327) 25%,
    var(--surface-raised, #141416) 50%,
    var(--surface-hover, #232327) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
  border-radius: 8px;
}

/* ========================================
   Transaction Mode Toggle Component
   ======================================== */

.transaction-mode-toggle-container {
  display: inline-block;
}

/* Toggle Switch Base */
.toggle-switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem;
  background: var(--surface-raised, #18181b);
  border: 1px solid var(--border-subtle, #27272a);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.toggle-switch:hover {
  border-color: var(--border-emphasis, #3f3f46);
  background: var(--surface-hover, #1f1f23);
}

.toggle-switch:focus-visible {
  outline: 2px solid var(--primary-500, #7900C9);
  outline-offset: 2px;
}

/* Toggle Labels */
.toggle-label {
  position: relative;
  z-index: 2;
  padding: 0.25rem 1rem;
  min-width: 3.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary, #a1a1aa);
  transition: color 0.2s ease;
  white-space: nowrap;
  user-select: none;
  text-align: center;
}

.toggle-label.active {
  color: var(--text-primary, #fafafa);
}

/* Toggle Slider */
.toggle-slider {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  width: calc(50% - 0.25rem);
  height: calc(100% - 0.5rem);
  background: linear-gradient(135deg, var(--primary-500, #7900C9), var(--complement-purple, #9b51e0));
  border-radius: 9999px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.toggle-slider.slider-right {
  left: calc(50% + 0.25rem);
  background: linear-gradient(135deg, var(--primary-500, #7900C9), var(--complement-purple, #9b51e0));
}

/* Tooltip Styles */
.transaction-mode-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface-raised, #18181b);
  border: 1px solid var(--border-subtle, #27272a);
  border-radius: 0.5rem;
  width: 280px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Tooltip arrow */
.transaction-mode-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border-subtle, #27272a);
}

/* Show tooltip on hover */
.group:hover .transaction-mode-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .toggle-label {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }

  .transaction-mode-tooltip {
    width: 240px;
    font-size: 0.8125rem;
  }
}
