/* Custom styles for CPU Scheduling Visualizer - Premium Edition */

/* CSS Variables for consistent theming */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(20, 20, 35, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(139, 92, 246, 0.3);
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --glow-purple: rgba(139, 92, 246, 0.4);
  --glow-pink: rgba(236, 72, 153, 0.4);
  --glow-cyan: rgba(6, 182, 212, 0.4);
}

/* Global styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(236, 72, 153, 0.1), transparent),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(6, 182, 212, 0.1), transparent);
  min-height: 100vh;
}

/* Smooth scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.5);
}

/* Glass card effect */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow:
    0 4px 30px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  border-color: var(--border-glow);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.4),
    0 0 60px -20px var(--glow-purple),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Header styles */
.header-glass {
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.logo-container {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px var(--glow-purple);
  animation: logo-pulse 3s ease-in-out infinite;
}

@keyframes logo-pulse {

  0%,
  100% {
    box-shadow: 0 0 20px var(--glow-purple);
  }

  50% {
    box-shadow: 0 0 40px var(--glow-purple), 0 0 60px var(--glow-pink);
  }
}

.logo-title {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, var(--accent-purple) 50%, var(--accent-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Section titles */
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.section-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: dot-pulse 2s ease-in-out infinite;
}

.section-dot.purple {
  background: var(--accent-purple);
  box-shadow: 0 0 15px var(--glow-purple);
}

.section-dot.cyan {
  background: var(--accent-cyan);
  box-shadow: 0 0 15px var(--glow-cyan);
}

.section-dot.pink {
  background: var(--accent-pink);
  box-shadow: 0 0 15px var(--glow-pink);
}

.section-dot.emerald {
  background: var(--accent-emerald);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.section-dot.amber {
  background: var(--accent-amber);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

@keyframes dot-pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(0.9);
  }
}

/* Input styling */
.input-field {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.3s ease;
  outline: none;
}

.input-field::placeholder {
  color: var(--text-muted);
}

.input-field:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15), 0 0 20px rgba(139, 92, 246, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.input-field:hover:not(:focus) {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

.input-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Button styling */
.btn-primary {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-gradient-purple {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: white;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.btn-gradient-purple:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
}

.btn-gradient-cyan {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-emerald));
  color: var(--bg-primary);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}

.btn-gradient-cyan:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(6, 182, 212, 0.4);
}

.btn-gradient-amber {
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-rose));
  color: white;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

.btn-gradient-amber:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.4);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

/* Select styling */
.select-field {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a1a1aa'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 20px;
}

.select-field:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.select-field option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 12px;
}

/* Process chips */
.process-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.2);
  transition: all 0.3s ease;
  animation: chip-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chip-appear {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.process-chip:hover {
  border-color: var(--accent-purple);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.2);
}

.process-chip .delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.process-chip .delete-btn:hover {
  background: var(--accent-rose);
  color: white;
  transform: scale(1.1);
}

/* Gantt chart blocks */
.gantt-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 70px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: gantt-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
  transform: scale(0.5) translateY(20px);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

@keyframes gantt-bounce {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(30px);
  }

  60% {
    opacity: 1;
    transform: scale(1.08) translateY(-5px);
  }

  80% {
    transform: scale(0.95) translateY(2px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.gantt-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: gantt-shimmer 1s ease-out forwards;
  animation-delay: inherit;
}

@keyframes gantt-shimmer {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

.gantt-block:hover {
  transform: translateY(-6px) scale(1.05);
  z-index: 10;
}

.gantt-block.pulse-glow {
  animation: gantt-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    gantt-glow 2s ease-in-out;
}

@keyframes gantt-glow {

  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.2);
  }
}

.gantt-idle {
  background: repeating-linear-gradient(45deg,
      rgba(113, 113, 122, 0.2),
      rgba(113, 113, 122, 0.2) 6px,
      rgba(113, 113, 122, 0.3) 6px,
      rgba(113, 113, 122, 0.3) 12px);
  color: var(--text-muted);
  border: 1px dashed rgba(113, 113, 122, 0.4);
}

/* Process colors - Enhanced gradients */
.process-color-0 {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.process-color-1 {
  background: linear-gradient(135deg, #06b6d4, #22d3ee);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
}

.process-color-2 {
  background: linear-gradient(135deg, #ec4899, #f472b6);
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.4);
}

.process-color-3 {
  background: linear-gradient(135deg, #10b981, #34d399);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.process-color-4 {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.process-color-5 {
  background: linear-gradient(135deg, #f43f5e, #fb7185);
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.4);
}

.process-color-6 {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.process-color-7 {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

/* Timeline markers */
.timeline-marker {
  min-width: 60px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  padding-top: 8px;
  border-left: 1px dashed rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.timeline-marker:first-child {
  border-left: none;
}

/* Table styling */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead tr {
  background: rgba(255, 255, 255, 0.02);
}

.data-table th {
  padding: 16px 20px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
  transition: all 0.3s ease;
}

.data-table tbody tr:hover {
  background: rgba(139, 92, 246, 0.05);
}

.data-table td {
  padding: 16px 20px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Stat cards */
.stat-card {
  position: relative;
  padding: 24px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all 0.4s ease;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink), var(--accent-cyan));
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.stat-icon.cyan {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(16, 185, 129, 0.2));
  color: var(--accent-cyan);
}

.stat-icon.purple {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
  color: var(--accent-purple);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-emerald));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-value.purple {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* MLQ Queue cards */
.mlq-queue-card {
  padding: 20px;
  border-radius: 16px;
  border: 1px solid;
  transition: all 0.3s ease;
}

.mlq-queue-card:hover {
  transform: translateY(-2px);
}

.mlq-queue-card.q1 {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.1), rgba(236, 72, 153, 0.1));
  border-color: rgba(244, 63, 94, 0.3);
}

.mlq-queue-card.q2 {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.1));
  border-color: rgba(245, 158, 11, 0.3);
}

.mlq-queue-card.q3 {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(96, 165, 250, 0.1));
  border-color: rgba(59, 130, 246, 0.3);
}

/* Hint box */
.hint-box {
  padding: 16px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(236, 72, 153, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.hint-box p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.hint-box .hint-title {
  color: var(--accent-purple);
  font-weight: 600;
}

/* Comparison table highlights */
.highlight-best {
  color: var(--accent-emerald) !important;
  font-weight: 600;
  position: relative;
}

.highlight-best::after {
  content: '✓';
  margin-left: 6px;
  font-size: 0.75rem;
}

/* Floating particles (optional decorative) */
.floating-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--accent-purple);
  top: -200px;
  right: -100px;
  animation: float-slow 20s ease-in-out infinite;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--accent-pink);
  bottom: -150px;
  left: -100px;
  animation: float-slow 25s ease-in-out infinite reverse;
}

@keyframes float-slow {

  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }

  25% {
    transform: translate(30px, -30px) rotate(5deg);
  }

  50% {
    transform: translate(-20px, 20px) rotate(-5deg);
  }

  75% {
    transform: translate(20px, 10px) rotate(3deg);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .glass-card {
    border-radius: 20px;
  }

  .gantt-block {
    min-width: 50px;
    height: 60px;
    font-size: 0.85rem;
  }

  .timeline-marker {
    min-width: 50px;
    font-size: 0.75rem;
  }

  .stat-value {
    font-size: 2rem;
  }

  .btn-primary {
    padding: 14px 20px;
  }
}

/* Custom animations for page load */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fade-in-up 0.6s ease-out forwards;
}

.delay-100 {
  animation-delay: 0.1s;
}

.delay-200 {
  animation-delay: 0.2s;
}

.delay-300 {
  animation-delay: 0.3s;
}

.delay-400 {
  animation-delay: 0.4s;
}

/* Footer gradient line */
.footer-gradient {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-purple), var(--accent-pink), var(--accent-cyan), transparent);
}
