/* style.css - Custom Styling & Animations for FCFS CPU Scheduling Simulator */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', monospace;
}

body {
  font-family: var(--font-sans);
  background-color: #0b0f19;
  color: #e2e8f0;
  overflow-x: hidden;
}

.font-mono {
  font-family: var(--font-mono);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Diagonal Stripe for IDLE Block */
.idle-striped {
  background-color: #1e293b;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(100, 116, 139, 0.25),
    rgba(100, 116, 139, 0.25) 10px,
    rgba(30, 41, 59, 0.8) 10px,
    rgba(30, 41, 59, 0.8) 20px
  );
  border: 1px dashed #64748b !important;
}

/* Process Color Themes & Fallbacks */
.p-color-0 { --p-accent: #3b82f6; --p-bg: rgba(59, 130, 246, 0.25); --p-border: #3b82f6; }
.p-color-1 { --p-accent: #10b981; --p-bg: rgba(16, 185, 129, 0.25); --p-border: #10b981; }
.p-color-2 { --p-accent: #f59e0b; --p-bg: rgba(245, 158, 11, 0.25); --p-border: #f59e0b; }
.p-color-3 { --p-accent: #ec4899; --p-bg: rgba(236, 72, 153, 0.25); --p-border: #ec4899; }
.p-color-4 { --p-accent: #8b5cf6; --p-bg: rgba(139, 92, 246, 0.25); --p-border: #8b5cf6; }
.p-color-5 { --p-accent: #06b6d4; --p-bg: rgba(6, 182, 212, 0.25); --p-border: #06b6d4; }
.p-color-6 { --p-accent: #84cc16; --p-bg: rgba(132, 204, 22, 0.25); --p-border: #84cc16; }
.p-color-7 { --p-accent: #f97316; --p-bg: rgba(249, 115, 22, 0.25); --p-border: #f97316; }
.p-color-8 { --p-accent: #14b8a6; --p-bg: rgba(20, 184, 166, 0.25); --p-border: #14b8a6; }
.p-color-9 { --p-accent: #e11d48; --p-bg: rgba(225, 29, 72, 0.25); --p-border: #e11d48; }

/* Dynamic Class Color Fallbacks for Gantt & UI */
.bg-blue-600\/30 { background-color: rgba(37, 99, 235, 0.3) !important; }
.border-blue-500 { border-color: #3b82f6 !important; }
.bg-blue-500 { background-color: #3b82f6 !important; }

.bg-emerald-600\/30 { background-color: rgba(5, 150, 105, 0.3) !important; }
.border-emerald-500 { border-color: #10b981 !important; }
.bg-emerald-500 { background-color: #10b981 !important; }

.bg-amber-600\/30 { background-color: rgba(217, 119, 6, 0.3) !important; }
.border-amber-500 { border-color: #f59e0b !important; }
.bg-amber-500 { background-color: #f59e0b !important; }

.bg-pink-600\/30 { background-color: rgba(219, 39, 119, 0.3) !important; }
.border-pink-500 { border-color: #ec4899 !important; }
.bg-pink-500 { background-color: #ec4899 !important; }

.bg-purple-600\/30 { background-color: rgba(147, 51, 234, 0.3) !important; }
.border-purple-500 { border-color: #8b5cf6 !important; }
.bg-purple-500 { background-color: #8b5cf6 !important; }

.bg-cyan-600\/30 { background-color: rgba(8, 145, 178, 0.3) !important; }
.border-cyan-500 { border-color: #06b6d4 !important; }
.bg-cyan-500 { background-color: #06b6d4 !important; }

.bg-lime-600\/30 { background-color: rgba(101, 163, 13, 0.3) !important; }
.border-lime-500 { border-color: #84cc16 !important; }
.bg-lime-500 { background-color: #84cc16 !important; }

.bg-orange-600\/30 { background-color: rgba(234, 88, 12, 0.3) !important; }
.border-orange-500 { border-color: #f97316 !important; }
.bg-orange-500 { background-color: #f97316 !important; }

.bg-teal-600\/30 { background-color: rgba(13, 148, 136, 0.3) !important; }
.border-teal-500 { border-color: #14b8a6 !important; }
.bg-teal-500 { background-color: #14b8a6 !important; }

.bg-rose-600\/30 { background-color: rgba(225, 29, 72, 0.3) !important; }
.border-rose-500 { border-color: #f43f5e !important; }
.bg-rose-500 { background-color: #f43f5e !important; }

/* Pulse animation for active simulation process */
@keyframes activePulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.6), inset 0 0 10px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.9), inset 0 0 15px rgba(59, 130, 246, 0.5);
  }
}

.sim-active-pulse {
  animation: activePulse 1.8s infinite ease-in-out;
}

/* Glassmorphism card utility */
.glass-panel {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(51, 65, 85, 0.6);
}

.glass-panel-subtle {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.4);
}

/* Gantt Chart Interactive Hover Effect */
.gantt-block {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
}

.gantt-block:hover {
  transform: translateY(-2px);
  filter: brightness(1.2);
  z-index: 10;
}

.gantt-block.highlighted {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
  filter: brightness(1.25);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
}

.table-row-highlight {
  background-color: rgba(56, 189, 248, 0.15) !important;
  border-left: 4px solid #38bdf8 !important;
}

/* Tooltip on Gantt Block */
.gantt-tooltip {
  visibility: hidden;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, visibility 0.2s;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  z-index: 50;
}

.gantt-block:hover .gantt-tooltip {
  visibility: visible;
  opacity: 1;
}

/* Progress indicator on running simulation */
.sim-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  z-index: 25;
  transition: left 0.15s linear;
  pointer-events: none;
}

.sim-needle::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  width: 10px;
  height: 10px;
  background-color: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 6px #ef4444;
}

/* Queue Card Entrance Animation */
@keyframes slideInQueue {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.queue-item-anim {
  animation: slideInQueue 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Collapsible accordion transition */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out;
}

.accordion-content.open {
  max-height: 1600px;
  transition: max-height 0.45s ease-in;
}

/* Print Friendly Styles */
@media print {
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
  }
  .no-print {
    display: none !important;
  }
  .glass-panel {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
  }
}
