/* public/css/custom.css */
/* Modern system font stack (100% offline, zero CSP violations) */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #F4F7FB;
  background-image:
    radial-gradient(at 0% 0%, rgba(36, 53, 104, 0.045) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(12, 130, 122, 0.04) 0px, transparent 45%);
  color: #1e293b;
}

code, pre, .font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Base Image & Media Reset */
img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  vertical-align: middle;
}

img {
  max-width: 100%;
  height: auto;
}

/* Fail-safe image dimension utilities */
.w-14 { width: 3.5rem !important; max-width: 3.5rem !important; }
.h-14 { height: 3.5rem !important; max-height: 3.5rem !important; }
.w-9 { width: 2.25rem !important; max-width: 2.25rem !important; }
.h-9 { height: 2.25rem !important; max-height: 2.25rem !important; }
.rounded-full { border-radius: 9999px !important; }
.object-cover { object-fit: cover !important; }

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Hidden scrollbar for horizontal tab bars */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Premium Animations & Micro-interactions */
@keyframes viewFadeSlide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-view-enter {
  animation: viewFadeSlide 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stagger-1 { animation: viewFadeSlide 0.28s cubic-bezier(0.16, 1, 0.3, 1) 0.04s both; }
.stagger-2 { animation: viewFadeSlide 0.28s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both; }
.stagger-3 { animation: viewFadeSlide 0.28s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both; }
.stagger-4 { animation: viewFadeSlide 0.28s cubic-bezier(0.16, 1, 0.3, 1) 0.16s both; }

/* Card elevation & hover lift */
.card-elevated {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
}

.card-interactive {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(30, 27, 75, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  border-color: #cbd5e1;
}

/* Tactile button press */
.btn-press {
  transition: transform 0.12s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-press:active:not(:disabled) {
  transform: scale(0.975);
}

/* Loading shimmer */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton-shimmer {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

/* Field auto-fill flash */
@keyframes fieldFlash {
  0% { background-color: #d1fae5; border-color: #10b981; }
  100% { background-color: #ffffff; }
}
.field-autofilled {
  animation: fieldFlash 1.2s ease-out;
}

/* Radar SVG animation & glow */
@keyframes radarExpand {
  from {
    opacity: 0;
    transform: scale(0.72);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.radar-polygon {
  transform-box: fill-box;
  transform-origin: center;
  animation: radarExpand 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.25s ease, stroke-width 0.2s ease;
  filter: drop-shadow(0 4px 12px rgba(36, 53, 104, 0.18));
}

.radar-spoke {
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
}
.radar-spoke:hover {
  stroke: #D89524;
  stroke-width: 2.5;
  cursor: pointer;
}

.radar-point {
  transition: r 0.2s ease, fill 0.2s ease, opacity 0.2s ease;
}
.radar-point:hover {
  r: 6.5;
  fill: #D89524;
  cursor: pointer;
}

/* Dirty cell indicator */
.cell-dirty {
  background-color: #fef3c7 !important;
  border-left: 3px solid #d97706 !important;
}

/* Saffron gold gradient text */
.text-saffron-gold {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 50%, #b45309 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (max-width: 639px) {
  .radar-label-text {
    font-size: 11.5px;
  }
}

@media print {
  body {
    background: #ffffff !important;
    height: auto !important;
    overflow: visible !important;
  }
  #app-header, #app-sidebar, #app-footer, #sidebar-backdrop, #toast-container {
    display: none !important;
  }
}
