@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin-slow {
  animation: spinSlow 12s linear infinite;
}

/* Custom modern scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #06b6d4;
}

/* Active navigation tab styling */
.nav-tab.active {
  background-color: #0891b2;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
}

.plat-filter-btn.active {
  background-color: #06b6d4;
  color: #0b0f19;
}

.modal-tab.active {
  color: #06b6d4;
  border-bottom-color: #06b6d4;
}

/* Card hover transitions */
.account-card {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.account-card:hover {
  transform: translateY(-2px);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(6, 182, 212, 0.1);
}

/* Event badge colors */
.badge-avatar_changed {
  background-color: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-post_deleted {
  background-color: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-post_added {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-followers_changed {
  background-color: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-follower_added {
  background-color: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-follower_removed {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-friends_changed {
  background-color: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-friend_added {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-friend_removed {
  background-color: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-like_added {
  background-color: rgba(244, 63, 94, 0.18);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.badge-info_changed {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-online_status_changed {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-story_added {
  background-color: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.4);
}

.badge-story_deleted {
  background-color: rgba(225, 29, 72, 0.2);
  color: #fda4af;
  border: 1px solid rgba(225, 29, 72, 0.4);
}

.badge-pin_added {
  background-color: rgba(225, 29, 72, 0.15);
  color: #fb7185;
  border: 1px solid rgba(225, 29, 72, 0.35);
}

.badge-pin_deleted {
  background-color: rgba(159, 18, 57, 0.25);
  color: #fda4af;
  border: 1px solid rgba(225, 29, 72, 0.4);
}

.badge-board_added {
  background-color: rgba(244, 63, 94, 0.2);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.badge-board_removed {
  background-color: rgba(136, 19, 55, 0.25);
  color: #fecdd3;
  border: 1px solid rgba(225, 29, 72, 0.4);
}

.badge-board_pins_changed {
  background-color: rgba(244, 63, 94, 0.18);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.avatar-story-ring {
  box-shadow: 0 0 0 2.5px #0f172a, 0 0 0 4.5px #ec4899;
}

/* Hide scrollbars while keeping touch/scroll functionality */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Target folder card styling */
.target-folder-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
}

.target-folder-card:hover {
  transform: translateY(-2px);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.6), 0 4px 12px -2px rgba(6, 182, 212, 0.12);
}

/* Mobile bottom nav active button */
.mobile-nav-btn.active {
  color: #22d3ee;
}
.mobile-nav-btn.active i {
  color: #22d3ee;
  transform: scale(1.1);
  transition: transform 0.15s ease;
}

/* Safe area padding for mobile devices with home indicator */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .safe-area-bottom {
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
  }
}

/* Modal Tabs custom horizontal scrollbar & touch styling */
.modal-tabs-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #334155 rgba(15, 23, 42, 0.6);
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.modal-tabs-scroll::-webkit-scrollbar {
  height: 4px;
}

.modal-tabs-scroll::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 9999px;
}

.modal-tabs-scroll::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 9999px;
}

.modal-tabs-scroll::-webkit-scrollbar-thumb:hover {
  background: #06b6d4;
}

/* Modal responsive container improvements */
.modal-overlay {
  display: flex;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-dialog {
  display: flex;
  flex-direction: column;
  margin: auto;
  max-height: calc(100dvh - 1.5rem);
  width: 100%;
}

@media (min-width: 640px) {
  .modal-dialog {
    max-height: calc(100dvh - 3rem);
  }
}

/* Leaflet map styles for GeoGuess OSINT */
#geoguess-map {
  z-index: 10;
  width: 100%;
  height: 440px;
  border-radius: 1rem;
}
.leaflet-container {
  font-family: inherit;
  background-color: #0f172a;
}
.leaflet-popup-content-wrapper {
  background-color: #111827 !important;
  color: #f1f5f9 !important;
  border: 1px solid #334155 !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7) !important;
}
.leaflet-popup-tip {
  background-color: #111827 !important;
}

/* ==============================================================================
   RESPONSIVE SCREEN SCALING & ANTI-OVERLAP RULES
   ============================================================================== */

/* Prevent root horizontal overflow across all devices */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

/* Fluid image, video, and canvas bounding */
img, video, canvas {
  max-width: 100%;
  height: auto;
}

/* Navigation tabs responsive flex wrapping prevention */
.nav-tab {
  flex-shrink: 0;
  white-space: nowrap;
  user-select: none;
}

/* Mobile navigation buttons: touch-friendly minimum width & anti-overlap */
.mobile-nav-btn {
  flex-shrink: 0;
  min-width: 56px;
  white-space: nowrap;
  user-select: none;
}

/* Account & Folder cards inside CSS Grids: enforce containment to prevent column blow-out */
.account-card, .target-folder-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  word-break: break-word;
}

/* Prevent long text in flex children from overflowing */
.truncate-safe {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Modal responsive dialog sizing */
.modal-dialog-responsive {
  max-height: calc(100dvh - 1.5rem);
  max-width: calc(100vw - 1rem);
  width: 100%;
  display: flex;
  flex-direction: column;
  margin: auto;
  overflow: hidden;
}

@media (min-width: 640px) {
  .modal-dialog-responsive {
    max-height: calc(100dvh - 3rem);
    max-width: calc(100vw - 2rem);
  }
}

/* CV Match Canvas & Image container */
#cv-canvas-wrapper {
  max-width: 100%;
  max-height: 52vh;
  position: relative;
  overflow: hidden;
}

#cv-search-preview-img {
  max-width: 100%;
  max-height: 52vh;
  object-fit: contain;
}

#cv-search-face-canvas {
  max-width: 100%;
  max-height: 52vh;
}

/* Tables in card containers */
.table-responsive-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Desktop navigation bar smooth horizontal scrolling & indicators */
#desktop-nav-bar {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

#nav-scroll-prev, #nav-scroll-next {
  backdrop-filter: blur(8px);
}


