/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Compact Lexxy editor for inline note form */
.inline-note-editor lexxy-toolbar {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0.25rem;
}

.inline-note-editor lexxy-editor {
  border: none;
  min-height: 80px;
  padding: 0;
}

.inline-note-editor lexxy-editor:focus {
  outline: none;
  box-shadow: none;
}

/* Dark mode support for inline editor */
.dark .inline-note-editor lexxy-toolbar {
  background: transparent;
}

.dark .inline-note-editor lexxy-editor {
  background: #0f172a;
  color: #f1f5f9;
}

/* Compact Lexxy editor for nested note form */
.nested-note-editor lexxy-toolbar {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0.25rem;
}

.nested-note-editor lexxy-editor {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  min-height: 80px;
}

.nested-note-editor lexxy-editor:focus-within {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

/* Dark mode support for nested note editor */
.dark .nested-note-editor lexxy-toolbar {
  background: transparent;
}

.dark .nested-note-editor lexxy-editor {
  background: #1e293b;
  border-color: #475569;
  color: #f1f5f9;
}

.dark .nested-note-editor lexxy-editor:focus-within {
  border-color: #3b82f6;
}

/* Fix turbo-frame inside tables - make it invisible to layout */
table turbo-frame {
  display: contents;
}

/* Tab content padding removal on mobile - uses :has() which Tailwind can't do */
@media (max-width: 767px) {
  .border-b:has([role="tablist"]) + div {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* ============================================
   Valuation Status Dots - Animated indicators
   ============================================ */

/* Base status dot styles */
.status-dot {
  width: 0.625rem; /* 10px / 2.5 = w-2.5 */
  height: 0.625rem;
  border-radius: 9999px;
  display: inline-block;
  flex-shrink: 0;
}

/* Overdue - pulsing red dot */
.status-dot-overdue {
  background-color: #ef4444; /* red-500 */
  animation: pulse-red 1.5s ease-in-out infinite;
}

/* Due Soon/Today - pulsing yellow/amber dot */
.status-dot-due-soon {
  background-color: #f59e0b; /* amber-500 */
  animation: pulse-amber 2s ease-in-out infinite;
}

/* On Track - solid green dot (no animation) */
.status-dot-on-track {
  background-color: #22c55e; /* green-500 */
}

/* No valuations yet - hollow gray dot */
.status-dot-none {
  background-color: transparent;
  border: 2px solid #cbd5e1; /* slate-300 */
}

/* Pulse animations */
@keyframes pulse-red {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
  }
}

@keyframes pulse-amber {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0);
  }
}

/* ============================================
   Mobile Layout - CSS that Tailwind can't handle
   ============================================ */
@media (max-width: 767px) {
  /* Remove shadows from cards - global override */
  .shadow-sm,
  .shadow-border-xs,
  .shadow-lg,
  .shadow-xl,
  .shadow-2xl {
    box-shadow: none !important;
  }

  /* Softer borders on cards - global override */
  .rounded-lg,
  .rounded-xl {
    border-color: #f1f5f9 !important; /* slate-100 - very subtle */
  }

  /* Reduce padding on mobile for more content space */
  .px-4 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* ============================================
     Mobile Typography & Color Overrides
     CoinMarketCap-inspired readability
     ============================================ */

  /* Darker text for better contrast */
  .text-slate-900,
  .text-slate-800 {
    color: #0f172a !important; /* slate-950 */
  }

  /* Vibrant gain colors - unified green */
  .text-emerald-500,
  .text-emerald-600,
  .text-green-500 {
    color: #16a34a !important; /* green-600 */
  }

  /* Vibrant loss colors - unified red */
  .text-red-500 {
    color: #dc2626 !important; /* red-600 */
  }

  /* Darker labels for better readability */
  .text-slate-500 {
    color: #475569 !important; /* slate-600 */
  }
}

/* ============================================
   Custom Thin Scrollbar for Notes List
   ============================================ */

/* WebKit browsers (Chrome, Safari, Edge) */
.notes-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.notes-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.notes-scrollbar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
}

.notes-scrollbar:hover::-webkit-scrollbar-thumb {
  background: #cbd5e1; /* slate-300 */
}

/* Firefox */
.notes-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.notes-scrollbar:hover {
  scrollbar-color: #cbd5e1 transparent;
}
