/* custom.css - Modern animations and UI smoothness */
:root {
  --t-fast: 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-logo {
  height: 28px; width: auto; border-radius: var(--r-sm); object-fit: contain;
}
.admin-top .custom-logo { height: 22px; }

/* AI Processing Overlay Enhancements */
.ai-overlay {
  position: absolute; inset: 0; background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 50; opacity: 0; pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-overlay.is-active { opacity: 1; pointer-events: auto; }

.pcb-loader { width: 120px; height: 120px; position: relative; }
.pcb-loader svg {
  width: 100%; height: 100%; stroke: var(--accent-bright); fill: none;
  stroke-width: 2.5; stroke-dasharray: 300; stroke-dashoffset: 300;
  animation: drawTrace 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}
.pcb-loader .node { fill: var(--accent-bright); animation: pulseNode 1.5s ease-in-out infinite alternate; }

@keyframes drawTrace { 0% { stroke-dashoffset: 300; } 100% { stroke-dashoffset: 0; } }
@keyframes pulseNode { 0% { opacity: 0.4; transform: scale(0.7); } 100% { opacity: 1; transform: scale(1.3); box-shadow: 0 0 10px var(--accent-bright); } }

.ai-status-text {
  margin-top: 28px; font-family: ui-monospace, monospace; color: var(--accent-bright);
  font-size: var(--fs-sm); letter-spacing: 0.15em; text-transform: uppercase;
  animation: pulseText 2s ease-in-out infinite;
}
@keyframes pulseText { 50% { opacity: 0.4; text-shadow: 0 0 8px var(--accent-bright); } }

/* Login Page SVG Animation Enhancements */
.animated-pcb { transform: translateY(0px); animation: float 6s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.animated-pcb .ambient-pulse { animation: ambientPulse 4s ease-in-out infinite alternate; }
@keyframes ambientPulse { 0% { opacity: 0.1; } 100% { opacity: 0.25; transform: scale(1.05); transform-origin: center; } }

.animated-pcb .traces path { stroke-dasharray: 400; stroke-dashoffset: 400; animation: pcbFlow 4s ease-in-out infinite alternate; }
.animated-pcb .traces path:nth-child(2) { animation-delay: 0.5s; }
.animated-pcb .traces path:nth-child(3) { animation-delay: 1.0s; }
.animated-pcb .traces path:nth-child(4) { animation-delay: 1.5s; }

@keyframes pcbFlow {
  0% { stroke-dashoffset: 400; opacity: 0.1; }
  50% { opacity: 1; filter: drop-shadow(0 0 3px var(--accent)); }
  100% { stroke-dashoffset: 0; opacity: 0.9; }
}

.pad-pulse circle { animation: padGlow 2s ease-in-out infinite alternate; }
@keyframes padGlow { 0% { opacity: 0.7; } 100% { opacity: 1; fill: var(--accent-bright); } }

.chip-pulse { animation: chipProcessing 3s ease-in-out infinite; }
@keyframes chipProcessing {
  0%, 100% { stroke: var(--layer-silk); fill: transparent; }
  50% { stroke: var(--accent-bright); fill: rgba(255, 150, 0, 0.15); }
}

/* Global Smoothness */
.btn, .btn-submit, .rail-btn {
  transition: background var(--t-fast), transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow var(--t-fast) !important;
  will-change: transform;
}
.btn:active:not(:disabled), .btn-submit:active:not(:disabled), .rail-btn:active { transform: scale(0.95); }
.panel-body { transition: max-height var(--t-smooth), opacity var(--t-smooth), padding var(--t-smooth); }
