/* styles/components.css */

/* Core Containers */
.container-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 992px) {
  .container-grid-2-1 {
    grid-template-columns: 2fr 1fr;
  }
  .container-grid-1-2 {
    grid-template-columns: 1fr 2fr;
  }
  .container-grid-3-col {
    grid-template-columns: 320px 1fr 380px;
  }
  .container-grid-equal-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Antigravity Glassmorphism Cards */
.antigravity-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow-float);
  transition: var(--transition-smooth);
  position: relative;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.antigravity-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 50px rgba(11, 19, 43, 0.12);
  border-color: rgba(58, 134, 255, 0.25);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Headings and Intros */
.section-intro {
  margin-bottom: 2rem;
  max-width: 800px;
}

.section-intro h2 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.section-intro p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--gradient-antigravity);
  color: white;
  box-shadow: var(--shadow-electric);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(58, 134, 255, 0.4);
  background: linear-gradient(to top, #152238, #5094ff);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: white;
  color: var(--brand-electric);
  border: 1px solid rgba(58, 134, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(58, 134, 255, 0.05);
  border-color: var(--brand-electric);
  transform: translateY(-2px);
}

.btn-glow {
  background: var(--brand-glow);
  color: var(--text-primary);
  box-shadow: var(--shadow-glow);
}

.btn-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.7);
}

.btn-danger {
  background: #EF4444;
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: #DC2626;
  transform: translateY(-2px);
}

.btn-disabled, .btn:disabled {
  background: #E2E8F0;
  color: #A0AEC0;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

/* Badges / Labels */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-glow {
  background: var(--brand-glow);
  color: var(--text-primary);
  box-shadow: 0 0 8px var(--brand-glow-muted);
}

.badge-electric {
  background: rgba(58, 134, 255, 0.1);
  color: var(--brand-electric);
  border: 1px solid rgba(58, 134, 255, 0.2);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Code Display Block */
.code-window {
  background: #0B132B; /* Cosmic Deep Dark */
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  color: #E2E8F0;
  font-family: 'Consolas', 'Fira Code', Monaco, monospace;
  font-size: 1.02rem;
}

.code-header {
  background: #1C2541;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-dots {
  display: flex;
  gap: 0.4rem;
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.code-dot.red { background: #EF4444; }
.code-dot.yellow { background: #F59E0B; }
.code-dot.green { background: #10B981; }

.code-title {
  font-size: 0.8rem;
  color: #A0AEC0;
  letter-spacing: 0.05em;
}

.code-content {
  padding: 1rem;
  overflow-x: auto;
  line-height: 1.5;
}

.code-line {
  display: flex;
  transition: background-color 0.2s;
  border-radius: 3px;
}

.code-line-num {
  width: 2rem;
  text-align: right;
  padding-right: 0.8rem;
  color: #4A5568;
  user-select: none;
}

.code-line-text {
  flex: 1;
}

.code-line.covered {
  background: rgba(16, 185, 129, 0.15);
  border-left: 3px solid #10B981;
}

.code-line.current-hit {
  background: rgba(58, 134, 255, 0.25);
  border-left: 3px solid var(--brand-electric);
  animation: pulse-hit 0.8s infinite alternate;
}

.code-line.crash-line {
  background: rgba(239, 68, 68, 0.25);
  border-left: 3px solid #EF4444;
}

/* Console Window (Terminals) */
.console-window {
  background: #050B14;
  border-radius: 12px;
  border: 1px solid rgba(58, 134, 255, 0.15);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  color: #39FF14; /* Neon green terminal */
  font-family: 'Consolas', monospace;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  height: 280px;
}

.console-window.error-state {
  border-color: rgba(239, 68, 68, 0.4);
  color: #FF5A5A;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}

.console-header {
  background: #0B132B;
  padding: 0.4rem 1rem;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(58, 134, 255, 0.1);
  color: #A0AEC0;
  font-size: 0.75rem;
}

.console-body {
  padding: 1rem;
  flex: 1;
  overflow-y: auto;
  white-space: pre-wrap;
  scroll-behavior: smooth;
}

/* Custom Switches & Controls */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.toggle-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(58, 134, 255, 0.08);
  border-radius: 10px;
  transition: var(--transition-smooth);
}

.toggle-container:hover {
  background: rgba(255, 255, 255, 0.8);
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #CBD5E0;
  transition: .4s;
  border-radius: 34px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4.5px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .slider-round {
  background-color: var(--brand-electric);
}

input:checked + .slider-round:before {
  transform: translateX(24px);
}

/* Dropdown styling */
.custom-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: white;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.custom-select:focus {
  border-color: var(--brand-electric);
  box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.15);
}

/* Custom Input Sliders */
.range-slider-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.range-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #E2E8F0;
  outline: none;
  margin: 10px 0;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-electric);
  cursor: pointer;
  box-shadow: var(--shadow-electric);
  transition: transform 0.1s;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Pedagogical Info Box */
.info-box {
  background: rgba(58, 134, 255, 0.05);
  border-left: 4px solid var(--brand-electric);
  border-radius: 0 12px 12px 0;
  padding: 1.25rem;
  margin-top: 1.5rem;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.info-box-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Pulsing coverage keyframe */
@keyframes pulse-hit {
  from {
    background-color: rgba(58, 134, 255, 0.15);
  }
  to {
    background-color: rgba(58, 134, 255, 0.4);
  }
}

/* Folder Tree Visual CSS */
.folder-tree {
  font-family: 'Consolas', 'Fira Code', Monaco, monospace;
  font-size: 0.85rem;
  background: #0B132B;
  border: 1px solid rgba(58, 134, 255, 0.2);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin-top: 0.6rem;
  width: 100%;
  text-align: left;
  color: #A0AEC0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  animation: slide-in-up-keyframes 0.3s ease-out forwards;
}

.folder-tree .tree-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0;
  line-height: 1.3;
}

.folder-tree .tree-folder {
  color: var(--brand-glow); /* Yellow folders */
  font-weight: 700;
}

.folder-tree .tree-file {
  color: #E2E8F0;
  font-weight: 500;
}

.folder-tree .tree-file-highlight {
  color: var(--brand-electric);
  font-weight: 600;
}

.folder-tree .tree-tag {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  font-size: 0.65rem;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  font-weight: 700;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.folder-tree .tree-tag-ok {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  font-size: 0.65rem;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Slider Guides for tmin */
.slider-guide-bar {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0 0.25rem;
}

.slider-guide-segment {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.slider-guide-segment.red { color: #EF4444; }
.slider-guide-segment.green { color: #10B981; }
.slider-guide-segment.orange { color: #F59E0B; }

