/* ===================================
   BEYOND CLOUD TECHNOLOGY - BASE DESIGN SYSTEM
   =================================== */

/* Import Modern Typography */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap");

/* ===================================
   CSS VARIABLES - DESIGN TOKENS
   =================================== */
:root {
  /* Dark Theme Colors */
  --color-bg-primary: #0a0e1a;
  --color-bg-secondary: #131829;
  --color-bg-tertiary: #1a2035;
  --color-bg-glass: rgba(26, 32, 53, 0.7);
  --color-bg-glass-hover: rgba(26, 32, 53, 0.85);

  /* Accent Colors */
  --color-accent-primary: #6366f1;
  --color-accent-secondary: #8b5cf6;
  --color-accent-success: #10b981;
  --color-accent-warning: #f59e0b;
  --color-accent-danger: #ef4444;
  --color-accent-info: #3b82f6;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);

  /* Text Colors */
  --color-text-primary: #f8fafc;
  --color-text-secondary: #cbd5e1;
  --color-text-tertiary: #94a3b8;
  --color-text-muted: #64748b;

  /* Border & Shadow */
  --color-border: rgba(148, 163, 184, 0.1);
  --color-border-hover: rgba(148, 163, 184, 0.2);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Typography */
  --font-primary: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   GLOBAL RESET & BASE STYLES
   =================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background var(--transition-base), color var(--transition-base);
}

/* Animated Background */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 20% 30%,
      rgba(99, 102, 241, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(139, 92, 246, 0.1) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 0;
}

/* =========================================
   GTmetrix Dashboard
   ========================================= */
.gtmetrix-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dashboard-card {
  background: var(--color-bg-tertiary); /* Darker internal card */
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

.grade-card h3 {
  margin-bottom: 1rem;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.grade-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: 800;
  color: #fff;
  background: #444;
  transition: all 0.5s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.grade-a {
  background: #0cce6b;
  box-shadow: 0 0 20px rgba(12, 206, 107, 0.4);
}
.grade-b {
  background: #0ba759;
}
.grade-c {
  background: #ffaa00;
}
.grade-d {
  background: #ff4e00;
}
.grade-f {
  background: #ff0000;
}

.scores-card {
  flex-direction: row;
  gap: 2rem;
}

.score-item {
  text-align: center;
}
.score-label {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}
.score-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
}
.score-divider {
  width: 1px;
  height: 60px;
  background: var(--color-border);
}

.vitals-card {
  align-items: stretch;
}
.vitals-card h3 {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
}
.vitals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  text-align: center;
}
.vital-label {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.vital-value {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--color-accent);
}

/* Filmstrip */
.filmstrip-container {
  display: flex;
  overflow-x: auto;
  gap: 0.5rem;
  padding: 1rem 0;
  scrollbar-width: thin;
}
.filmstrip-frame {
  flex: 0 0 auto;
  width: 100px;
  text-align: center;
}
.filmstrip-frame img {
  width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  margin-bottom: 0.25rem;
}
.frame-time {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* Checkbox */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}
.checkbox-container input {
  width: 16px;
  height: 16px;
}

/* ===================================
   LAYOUT STRUCTURE
   =================================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-xl);
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
  animation: fadeInDown 0.6s ease-out;
  position: relative;
  display: block;
}

.header-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title {
  font-size: 3rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--spacing-xs);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  line-height: 1.2;
}

.title-icon {
  width: 2.5rem;
  height: 2.5rem;
  stroke: url(#gradient);
  color: var(--color-accent-primary);
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
  margin-bottom: var(--spacing-xs);
}

.subtitle {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  font-weight: 300;
  margin-bottom: var(--spacing-sm);
}

/* YouTube Link */
.youtube-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
  transition: all var(--transition-base);
  animation: pulse-glow 2s ease-in-out infinite;
  margin-top: var(--spacing-md);
}

.youtube-link:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 4px 15px rgba(255, 0, 0, 0.5);
  animation: none;
  color: white;
}

.youtube-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
  }

  50% {
    box-shadow: 0 2px 15px rgba(255, 0, 0, 0.5);
  }
}

/* Footer */
.footer {
  text-align: center;
  margin-top: var(--spacing-2xl);
  padding: var(--spacing-xl) 0;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  align-items: center;
}

/* GitHub Link */
.github-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-lg);
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.1) 0%,
    rgba(139, 92, 246, 0.1) 100%
  );
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  color: var(--color-accent-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
}

.github-link:hover {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.2) 0%,
    rgba(139, 92, 246, 0.2) 100%
  );
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
  color: var(--color-accent-primary);
}

.github-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* Version Badge */
.version-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-lg);
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.1) 0%,
    rgba(5, 150, 105, 0.1) 100%
  );
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  border-radius: 50px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  margin: 0 auto;
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
}

.version-badge:hover {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.15) 0%,
    rgba(5, 150, 105, 0.15) 100%
  );
  border-color: rgba(16, 185, 129, 0.5);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.badge-icon {
  width: 1rem;
  height: 1rem;
  color: var(--color-accent-success);
  flex-shrink: 0;
}

.commit-id {
  color: var(--color-accent-success);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.version-separator {
  color: rgba(16, 185, 129, 0.5);
  font-weight: 300;
}

.commit-age {
  color: var(--color-text-secondary);
  font-weight: 400;
}

/* ===================================
   GLASS PANEL COMPONENT
   =================================== */
.panel {
  background: var(--color-bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.panel:hover {
  background: var(--color-bg-glass-hover);
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-lg);
}

.panel-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
}

.panel-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  font-size: 1.25rem;
}

.panel-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

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

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: var(--spacing-md);
  }

  .title {
    font-size: 2rem;
  }
}
/* ===================================
   TEST LAUNCHER COMPONENT
   =================================== */
.launcher-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.form-input {
  background: rgba(10, 14, 26, 0.6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

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

.form-row {
  display: flex;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}

.toggle-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  background: rgba(10, 14, 26, 0.4);
  padding: var(--spacing-xs);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.toggle-option {
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-tertiary);
  transition: all var(--transition-fast);
}

.toggle-option.active {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.6);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Loading State */
.loading-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Results Section */
.results-container {
  margin-top: var(--spacing-2xl);
  display: none; /* Hidden by default */
}

.results-container.visible {
  display: block;
  animation: fadeInDown 0.6s ease-out;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.metric-card {
  background: rgba(255, 255, 255, 0.05);
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  text-align: center;
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: var(--spacing-xs);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.metric-label {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.score-good {
  color: var(--color-accent-success);
  -webkit-text-fill-color: var(--color-accent-success);
}
.score-average {
  color: var(--color-accent-warning);
  -webkit-text-fill-color: var(--color-accent-warning);
}
.score-poor {
  color: var(--color-accent-danger);
  -webkit-text-fill-color: var(--color-accent-danger);
}

/* History List */
.history-list {
  margin-top: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--color-border);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-left: var(--spacing-md);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--color-text-secondary);
  color: white;
}

.report-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: var(--spacing-lg);
  gap: var(--spacing-md);
}

/* ===================================
   VIDEO PLAYER MODAL
   =================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: var(--color-bg-secondary);
  margin: 3% auto;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  width: 95%;
  max-width: 1400px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 1.5rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: var(--color-accent-danger);
}

.video-modal-content {
  max-width: 1200px;
  background: var(--color-bg-secondary);
}

.video-player-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: var(--spacing-lg);
}

.video-frame {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.video-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Carbon Card */
.carbon-card {
  border-color: rgba(16, 185, 129, 0.2);
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.05) 0%,
    rgba(5, 150, 105, 0.05) 100%
  );
}
.carbon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
}
.carbon-item {
  text-align: center;
}
.carbon-label {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
}
.carbon-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
}
.carbon-badge {
  margin-top: 1rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  background: rgba(16, 185, 129, 0.2);
  color: var(--color-accent-success);
  font-weight: 600;
}

.video-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: var(--spacing-sm);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
}

#video-play-btn {
  background: var(--color-accent-primary);
  color: white;
  border: none;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

#video-play-btn:hover {
  background: var(--color-accent-secondary);
  transform: translateY(-1px);
}

.video-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
}

.video-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-accent-primary);
  transition: width 0.1s linear;
}

#video-time {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--color-text-primary);
  min-width: 4rem;
  text-align: right;
}
