/**
 * Invisible Wealth - Interactive Styles
 * Styles for the Personal Wealth Algorithm functionality
 */

/* ============================================
   Value Selection Styles (values.html)
   ============================================ */

.value-item {
  cursor: pointer;
  /* Override Webflow transition to eliminate click lag */
  transition: none !important;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Keep background color transitions for visual feedback only */
.value-item:not(:active) {
  transition: background-color 0.15s ease !important;
}

/* Star icon hidden by default, shown when selected via JS */
.value-item .value-star {
  display: none;
}

/* Star is clickable when shown */
.value-item.selected .value-star {
  color: #9ca3af;
  cursor: pointer;
  padding: 6px;
  margin: -6px;
  /* no transition for instant response */
  position: relative;
  z-index: 2;
}

.value-item.selected .value-star:hover {
  transform: scale(1.2);
  color: #e7bd8d;
}

/* Gold star for core values */
.value-item.selected .value-star.active {
  color: #e7bd8d !important;
  transform: scale(1.1);
}

/* Core value card gets a subtle gold border */
.value-item.core-value {
  box-shadow: inset 0 0 0 1px rgba(231, 189, 141, 0.4);
}

/* ============================================
   Dropdown Selection Styles (data.html)
   ============================================ */

.form-select.has-selection .dropdown-label {
  color: #fff;
  font-weight: 500;
}

/* Limit dropdown height and add scroll */
.form-select .dropdown-menu {
  max-height: 240px;
  overflow-y: auto;
}

/* custom scrollbar for dropdown */
.form-select .dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.form-select .dropdown-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.form-select .dropdown-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.form-select .dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* ============================================
   Drag and Drop Styles (context.html)
   ============================================ */

.value-drag-item {
  cursor: grab;
  transition: all 0.2s ease;
  user-select: none;
}

.value-drag-item:active {
  cursor: grabbing;
}

.value-drag-item.dragging {
  opacity: 0.5;
  transform: scale(1.05);
}

.value-drag-counter {
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
}

.value-drag-counter.zero {
  opacity: 0.5;
}

/* drop zone hover */
.principle-drop-item {
  transition: all 0.2s ease;
}

.principle-drop-item.drag-over {
  transform: scale(1.02);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

/* Drop tags - use Webflow defaults, only add interaction styles */
.drop-tag {
  cursor: grab;
  transition: all 0.15s ease;
  user-select: none;
}

.drop-tag:hover {
  background-color: rgba(0, 0, 0, 0.75);
}

.drop-tag:active {
  cursor: grabbing;
}

/* Tag being dragged out for removal */
.drop-tag.dragging-out {
  opacity: 0.5;
  transform: scale(0.95);
  background-color: rgba(255, 100, 100, 0.3);
}

/* ============================================
   Priority Sorting Styles (priorities.html)
   ============================================ */

.context-drop-wrapper.prioritize .principle-drop-item {
  cursor: grab;
}

.context-drop-wrapper.prioritize .principle-drop-item:active {
  cursor: grabbing;
}

.context-drop-wrapper.prioritize .principle-drop-item.dragging {
  opacity: 0.6;
  z-index: 100;
}

/* Sort grabber styling - positioned absolutely at top-left */
.sort-grabber-wrapper {
  z-index: 3;
  position: absolute !important;
  top: 16px;
  left: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Push title and content to the right to make room for sort grabber */
.context-drop-wrapper.prioritize .principle-drop-title {
  margin-left: 56px;
}

/* Ensure video overlay covers the card properly on priorities page */
.context-drop-wrapper.prioritize .video-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: linear-gradient(90deg, #313131, #31313100);
  width: 100%;
  height: 100%;
}

/* Priority counter at bottom left of card */
.priority-counter {
  position: absolute !important;
  bottom: 16px !important;
  left: 24px !important;
  top: auto !important;
  right: auto !important;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  z-index: 3;
}

.priority-counter .value-drag-counter {
  width: 32px;
  height: 32px;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 700;
}

/* ============================================
   Results Page Layout Fixes (results.html)
   ============================================ */

/* Uniform spacing from navbar and bottom of viewport */
.section_results {
  padding-top: 112px;
  padding-bottom: 112px;
  box-sizing: border-box;
}

/* Share card video - ensure video fits without cutoff */
.share-card {
  aspect-ratio: 9 / 16 !important;
}

.share-video video {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

/* ============================================
   Results Graph Styles (results.html)
   ============================================ */

/* Graph fill animation - Webflow handles base styling */
.graph-fill {
  transition: width 0.8s ease-out;
}


/* ============================================
   Form Validation Styles
   ============================================ */

.text-field:invalid:not(:placeholder-shown) {
  border-color: #ff6b6b;
}

.text-field:valid:not(:placeholder-shown) {
  border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Mobile/Touch Improvements
   ============================================ */

@media (max-width: 767px) {
  .value-drag-item {
    /* make touch targets bigger on mobile */
    padding: 0.75rem 1rem;
  }
  
  .principle-drop-item {
    /* tap instead of drag on mobile */
    cursor: pointer;
  }
  
  .selected-values-display {
    position: sticky;
    bottom: 80px;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.9);
  }
}

/* ============================================
   Animation Utilities
   ============================================ */

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-pulse {
  animation: pulse 0.3s ease-out;
}

/* ============================================
   Toast Notification Styles
   ============================================ */

@keyframes toastFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes toastFadeOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}

.iw-toast {
  font-family: inherit;
}
