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

body {
  font-family: "Courier New", Monaco, monospace;
  background: linear-gradient(135deg, #0a0e1a 0%, #1a1a2e 50%, #16213e 100%);
  background-attachment: fixed;
  color: #00ff88;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(
      90deg,
      rgba(0, 255, 136, 0.03) 1px,
      transparent 1px
    ),
    linear-gradient(180deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: -1;
}

/* Header */
header {
  padding: 20px;
  background: rgba(0, 20, 40, 0.95);
  backdrop-filter: blur(10px);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  border-bottom: 2px solid #00ff88;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

header.scrolled {
  background: rgba(0, 20, 40, 0.98);
  padding: 15px 20px;
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  background: linear-gradient(45deg, #00ff88, #00d4ff, #ff0080, #8000ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
  position: relative;
}

.logo::before {
  content: "⬢";
  position: absolute;
  left: -30px;
  top: 50%;
  transform: translateY(-50%);
  color: #00ff88;
  font-size: 20px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
  50% {
    opacity: 0.7;
    transform: translateY(-50%) scale(1.1);
  }
}

/* Main Content */
main {
  margin-top: 80px;
  min-height: 100vh;
}

/* Video Container */
.video-section {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #000a1a, #001a33);
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.3), 0 0 60px rgba(0, 212, 255, 0.2),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.video-wrapper::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #00ff88, #00d4ff, #ff0080, #8000ff);
  border-radius: 14px;
  z-index: -1;
  animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Custom Video Controls */
.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    to top,
    rgba(0, 20, 40, 0.95),
    rgba(0, 20, 40, 0.3)
  );
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  border-top: 1px solid rgba(0, 255, 136, 0.3);
  backdrop-filter: blur(10px);
}

.video-wrapper:hover .video-controls,
.video-controls.show {
  transform: translateY(0);
}

.controls-inner {
  display: flex;
  align-items: center;
  gap: 15px;
}

.play-pause-btn {
  background: linear-gradient(
    135deg,
    rgba(0, 255, 136, 0.2),
    rgba(0, 212, 255, 0.2)
  );
  border: 1px solid #00ff88;
  color: #00ff88;
  cursor: pointer;
  font-size: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.play-pause-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(0, 255, 136, 0.4),
    rgba(0, 212, 255, 0.4)
  );
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
  transform: scale(1.1);
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(0, 255, 136, 0.1);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(0, 255, 136, 0.3);
  overflow: hidden;
}

.progress-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 255, 136, 0.1) 50%,
    transparent 100%
  );
  animation: scan 2s linear infinite;
}

@keyframes scan {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.progress-filled {
  height: 100%;
  background: linear-gradient(
    90deg,
    #00ff88,
    #00d4ff,
    #ff0080,
    #8000ff,
    #00ff88
  );
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
  position: relative;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.progress-filled::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: #ffffff;
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

.time {
  font-size: 14px;
  color: #00ff88;
  min-width: 100px;
  text-align: right;
  font-family: "Courier New", monospace;
  text-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
}

/* Video Info Section */
.video-info {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.video-title {
  font-size: 2.5em;
  font-weight: bold;
  margin-bottom: 10px;
  background: linear-gradient(45deg, #00ff88, #00d4ff, #ff0080, #8000ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
  position: relative;
}

.video-title::before {
  content: "⬢ ⬢ ⬢";
  position: absolute;
  top: -20px;
  left: 0;
  color: rgba(0, 255, 136, 0.3);
  font-size: 12px;
  letter-spacing: 10px;
}

.video-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  color: rgba(0, 255, 136, 0.7);
  font-size: 14px;
  font-family: "Courier New", monospace;
}

.video-meta span:nth-child(odd) {
  position: relative;
}

.video-meta span:nth-child(odd)::before {
  content: "▸";
  margin-right: 5px;
  color: #00d4ff;
}

.video-description {
  font-size: 1.1em;
  line-height: 1.8;
  color: rgba(0, 255, 136, 0.9);
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(0, 255, 136, 0.05);
  border-left: 4px solid #00ff88;
  border-radius: 0 8px 8px 0;
  position: relative;
}

.video-description::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, #00ff88, transparent);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.btn {
  padding: 12px 24px;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

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

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

.btn-primary {
  background: linear-gradient(
    135deg,
    rgba(0, 255, 136, 0.2),
    rgba(0, 212, 255, 0.2)
  );
  color: #00ff88;
  border-color: #00ff88;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 25px rgba(0, 255, 136, 0.5);
  background: linear-gradient(
    135deg,
    rgba(0, 255, 136, 0.3),
    rgba(0, 212, 255, 0.3)
  );
}

.btn-secondary {
  background: rgba(0, 255, 136, 0.1);
  color: #00ff88;
  border-color: rgba(0, 255, 136, 0.3);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}

.btn-secondary:hover {
  background: rgba(0, 255, 136, 0.2);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

/* Liked button state */
.btn.liked {
  background: linear-gradient(
    135deg,
    rgba(255, 0, 128, 0.2),
    rgba(255, 107, 107, 0.2)
  );
  color: #ff0080;
  border-color: #ff0080;
  box-shadow: 0 0 20px rgba(255, 0, 128, 0.4);
}

.btn.liked:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 0, 128, 0.3),
    rgba(255, 107, 107, 0.3)
  );
  box-shadow: 0 5px 25px rgba(255, 0, 128, 0.6);
}

/* Theme Toggle */
.theme-toggle {
  padding: 12px 20px;
  border: 2px solid rgba(0, 255, 136, 0.3);
  border-radius: 8px;
  background: rgba(0, 255, 136, 0.1);
  color: #00ff88;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Courier New", monospace;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background: rgba(0, 255, 136, 0.2);
  border-color: rgba(0, 255, 136, 0.5);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
  transform: translateY(-1px);
}

.theme-toggle .theme-icon {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
  transform: rotate(20deg);
}

/* Light mode styles */
body.light-mode {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%);
  color: #1a202c;
}

body.light-mode::before {
  background-image: linear-gradient(
      90deg,
      rgba(15, 23, 42, 0.08) 1px,
      transparent 1px
    ),
    linear-gradient(180deg, rgba(15, 23, 42, 0.08) 1px, transparent 1px);
}

/* Header */
body.light-mode header {
  background: rgba(255, 255, 255, 0.98);
  border-bottom-color: #334155;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
}

body.light-mode .logo {
  background: linear-gradient(135deg, #1e40af, #0f172a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: bold;
}

/* Theme Toggle */
body.light-mode .theme-toggle {
  background: rgba(30, 64, 175, 0.1);
  color: #1e40af;
  border-color: rgba(30, 64, 175, 0.4);
}

body.light-mode .theme-toggle:hover {
  background: rgba(30, 64, 175, 0.2);
  border-color: rgba(30, 64, 175, 0.6);
  box-shadow: 0 0 20px rgba(30, 64, 175, 0.3);
}

/* Video Section */
body.light-mode .video-wrapper {
  border-color: rgba(30, 64, 175, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

body.light-mode .video-controls {
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(30, 64, 175, 0.2);
}

body.light-mode .play-pause-btn,
body.light-mode .fullscreen-btn {
  color: #1e40af;
  background: rgba(30, 64, 175, 0.1);
}

body.light-mode .play-pause-btn:hover,
body.light-mode .fullscreen-btn:hover {
  background: rgba(30, 64, 175, 0.2);
  transform: scale(1.1);
}

body.light-mode .progress-bar {
  background: rgba(30, 64, 175, 0.2);
}

body.light-mode .progress-filled {
  background: linear-gradient(90deg, #1e40af, #3b82f6);
}

body.light-mode .time {
  color: #334155;
  font-weight: 600;
}

/* Video Info */
body.light-mode .video-info h1 {
  color: #0f172a;
  font-weight: bold;
}

body.light-mode .video-meta {
  color: #475569;
  font-weight: 500;
}

body.light-mode .video-meta span:nth-child(odd)::before {
  color: #1e40af;
}

body.light-mode .video-description {
  color: #334155;
  background: rgba(30, 64, 175, 0.05);
  border-left-color: #1e40af;
  font-weight: 500;
  line-height: 1.7;
}

body.light-mode .video-description::before {
  background: linear-gradient(90deg, #1e40af, transparent);
}

/* Action Buttons */
body.light-mode .action-buttons .btn-primary {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #ffffff;
  border-color: #1e40af;
  box-shadow: 0 4px 20px rgba(30, 64, 175, 0.3);
  font-weight: 600;
}

body.light-mode .action-buttons .btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 8px 30px rgba(30, 64, 175, 0.4);
  transform: translateY(-2px);
}

body.light-mode .action-buttons .btn-secondary {
  background: rgba(30, 64, 175, 0.1);
  color: #1e40af;
  border-color: rgba(30, 64, 175, 0.4);
  box-shadow: 0 2px 10px rgba(30, 64, 175, 0.2);
  font-weight: 600;
}

body.light-mode .action-buttons .btn-secondary:hover {
  background: rgba(30, 64, 175, 0.2);
  border-color: rgba(30, 64, 175, 0.6);
  box-shadow: 0 4px 20px rgba(30, 64, 175, 0.3);
}

/* Formula Section */
body.light-mode .formula-section {
  background: linear-gradient(
    135deg,
    rgba(30, 64, 175, 0.03),
    rgba(59, 130, 246, 0.03)
  );
  border: 2px solid rgba(30, 64, 175, 0.2);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

body.light-mode .formula-header h2 {
  color: #0f172a;
  font-weight: bold;
}

body.light-mode .formula-title::before {
  color: #1e40af;
}

body.light-mode .formula-toggle {
  background: linear-gradient(
    135deg,
    rgba(30, 64, 175, 0.1),
    rgba(59, 130, 246, 0.1)
  );
  border-color: #1e40af;
  color: #1e40af;
  font-weight: 600;
}

body.light-mode .formula-toggle:hover {
  background: linear-gradient(
    135deg,
    rgba(30, 64, 175, 0.2),
    rgba(59, 130, 246, 0.2)
  );
  box-shadow: 0 0 15px rgba(30, 64, 175, 0.4);
}

body.light-mode .equation-block {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(30, 64, 175, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

body.light-mode .equation-block:hover {
  border-color: rgba(30, 64, 175, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

body.light-mode .equation-block h3 {
  color: #0f172a;
  font-weight: bold;
}

body.light-mode .equation-block .equation {
  color: #1e40af;
  font-weight: 600;
  font-size: 1.1em;
}

body.light-mode .equation-block .description {
  color: #475569;
  font-weight: 500;
}

/* Loading Spinner */
body.light-mode .loading-spinner {
  border-color: rgba(30, 64, 175, 0.3);
  border-top-color: #1e40af;
}

/* Liked button state in light mode */
body.light-mode .btn.liked {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
}

body.light-mode .btn.liked:hover {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  box-shadow: 0 8px 30px rgba(220, 38, 38, 0.5);
}

/* Formula Section */
.formula-section {
  background: linear-gradient(
    135deg,
    rgba(0, 255, 136, 0.05),
    rgba(0, 212, 255, 0.05)
  );
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 40px;
  border: 1px solid rgba(0, 255, 136, 0.2);
  position: relative;
  overflow: hidden;
}

.formula-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 255, 136, 0.1) 50%,
    transparent 100%
  );
  animation: scan 2s linear infinite;
}

.formula-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.formula-title {
  font-size: 1.5em;
  font-weight: bold;
  color: #00ff88;
  font-family: "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.formula-title::before {
  content: "∑ ";
  color: #00d4ff;
}

.formula-toggle {
  background: linear-gradient(
    135deg,
    rgba(0, 255, 136, 0.1),
    rgba(0, 212, 255, 0.1)
  );
  border: 1px solid #00ff88;
  color: #00ff88;
  padding: 8px 16px;
  border-radius: 4px;

  cursor: pointer;
  font-family: "Courier New", monospace;
  transition: all 0.3s ease;
}

.formula-toggle:hover {
  background: linear-gradient(
    135deg,
    rgba(0, 255, 136, 0.2),
    rgba(0, 212, 255, 0.2)
  );
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.formula-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.formula-content.show {
  max-height: 800px;
  overflow-y: auto;
}

.formula-display {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.equation-block {
  background: rgba(0, 255, 136, 0.05);
  border: 1px solid rgba(0, 255, 136, 0.1);
  border-radius: 8px;
  padding: 20px;
  position: relative;
}

.equation-block h3 {
  color: #00d4ff;
  font-size: 1.1em;
  margin-bottom: 10px;
  font-family: "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.equation {
  font-size: 1.2em;
  color: #00ff88;
  font-family: "Courier New", monospace;
  margin-bottom: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  border-left: 3px solid #00ff88;
}

.equation sub {
  font-size: 0.8em;
  color: #00d4ff;
}

.description {
  color: rgba(0, 255, 136, 0.7);
  font-size: 0.9em;
  font-family: "Courier New", monospace;
  line-height: 1.4;
}

/* Loading Spinner */
.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border: 3px solid rgba(0, 255, 136, 0.1);
  border-top-color: #00ff88;
  border-right-color: #00d4ff;
  border-radius: 50%;
  animation: blockchainSpin 1s linear infinite;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.loading-spinner::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border: 2px solid rgba(0, 212, 255, 0.2);
  border-top-color: #00d4ff;
  border-radius: 50%;
  animation: blockchainSpin 0.5s linear infinite reverse;
}

@keyframes blockchainSpin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .video-title {
    font-size: 1.8em;
  }

  .video-meta {
    flex-direction: column;
    gap: 10px;
  }

  .action-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .controls-inner {
    gap: 10px;
  }

  .time {
    min-width: 80px;
    font-size: 12px;
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus Styles */
button:focus,
a:focus {
  outline: 2px solid #00ff88;
  outline-offset: 2px;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

/* Blockchain-inspired hexagon patterns */
.video-info::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 100px;
  height: 100px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><polygon points="50,5 85,30 85,70 50,95 15,70 15,30" fill="none" stroke="%2300ff88" stroke-width="1" opacity="0.3"/></svg>');
  opacity: 0.3;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}
