/* ==========================================================================
   REUSABLE THEME CSS FOR GITHUB PAGES
   A modern, dark theme with interactive elements and smooth animations
   ========================================================================== */

/* ==========================================================================
   BASE STYLES & RESET
   ========================================================================== */

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

body {
  font-family: "Georgia", serif;
  background-color: #0a0a0a;
  color: #e0e0e0;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: normal;
  margin-bottom: 1rem;
}

h1 {
  font-size: 3.5rem;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 2.5rem;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h3 {
  font-size: 1.8rem;
  color: #4ecdc4;
}

p {
  margin-bottom: 1rem;
}

a {
  color: #4ecdc4;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #ff6b6b;
}

/* ==========================================================================
   LAYOUT COMPONENTS
   ========================================================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  min-height: 100vh;
  padding: 80px 50px;
  position: relative;
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Two-column grid layout */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: flex-start;
}

/* Three-column grid layout */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero {
  height: 100vh;
  background: linear-gradient(45deg, #1a1a2e, #16213e, #0f3460);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="25" cy="25" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="50" cy="10" r="1.5" fill="rgba(255,255,255,0.08)"/></svg>')
    repeat;
  animation: stars 20s linear infinite;
}

@keyframes stars {
  0% { transform: translateY(0); }
  100% { transform: translateY(-100px); }
}

.hero-content h1 {
  margin-bottom: 2rem;
  animation: fadeInUp 2s ease-out;
}

.hero-content p {
  font-size: 1.3rem;
  max-width: 800px;
  margin: 0 auto;
  opacity: 0;
  animation: fadeInUp 2s ease-out 0.5s forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
  cursor: pointer;
  font-size: 1.5rem;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* ==========================================================================
   SECTION BACKGROUNDS
   ========================================================================== */

.section-dark-1 {
  background: linear-gradient(135deg, #2c1810, #1a1a2e);
}

.section-dark-2 {
  background: linear-gradient(135deg, #0f3460, #1a1a2e);
}

.section-dark-3 {
  background: linear-gradient(135deg, #1a1a2e, #2c1810);
}

.section-dark-4 {
  background: linear-gradient(135deg, #16213e, #0f3460);
}

.section-dark-5 {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}

/* ==========================================================================
   CARDS & PANELS
   ========================================================================== */

.card {
  background: rgba(255, 255, 255, 0.05);
  padding: 2rem;
  border-radius: 15px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.card:hover::before {
  transform: translateX(100%);
}

.card:hover {
  border-color: #4ecdc4;
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(78, 205, 196, 0.2);
}

.panel {
  background: rgba(255, 255, 255, 0.05);
  padding: 2rem;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  color: white;
  cursor: pointer;
  font-family: 'Georgia', serif;
  font-size: 1rem;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

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

/* Button Variants */
.btn-primary {
  background: linear-gradient(45deg, #45b7d1, #4ecdc4);
}

.btn-primary:hover {
  box-shadow: 0 8px 20px rgba(69, 183, 209, 0.3);
}

.btn-secondary {
  background: linear-gradient(45deg, #ff6b6b, #ff9999);
}

.btn-secondary:hover {
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
  color: #e0e0e0;
}

.btn-cta {
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  padding: 20px 40px;
  font-size: 1.3rem;
}

.btn-cta:hover {
  box-shadow: 0 15px 35px rgba(255, 107, 107, 0.4);
  cursor: pointer;
}

.btn-large {
  padding: 20px 40px;
  font-size: 1.5rem;
  border-radius: 50px;
}

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */

.form-input {
  width: 100%;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(78, 205, 196, 0.3);
  border-radius: 10px;
  color: #e0e0e0;
  font-size: 1rem;
  font-family: 'Georgia', serif;
  margin-bottom: 1rem;
  resize: vertical;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: #4ecdc4;
  box-shadow: 0 0 20px rgba(78, 205, 196, 0.2);
}

.form-input::placeholder {
  color: rgba(224, 224, 224, 0.5);
}

.form-select {
  width: 100%;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 2px solid rgba(78, 205, 196, 0.3);
  color: white;
  border-radius: 8px;
  font-family: 'Georgia', serif;
  font-size: 1rem;
}

.form-select:focus {
  outline: none;
  border-color: #4ecdc4;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-textarea-large {
  min-height: 150px;
}

/* Slider Styles */
.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 5px;
  outline: none;
  transition: opacity 0.2s;
  margin: 0.5rem 0;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #4ecdc4;
  cursor: pointer;
  border-radius: 50%;
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #4ecdc4;
  cursor: pointer;
  border-radius: 50%;
  border: none;
}

/* ==========================================================================
   STATISTICS & CHARTS
   ========================================================================== */

.stats-container {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  min-width: 120px;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: #4ecdc4;
  display: block;
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(224, 224, 224, 0.7);
}

.chart-container {
  width: 100%;
  height: 300px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin: 2rem 0;
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 20px;
}

.chart-bar {
  width: 40%;
  margin: 0 10px;
  border-radius: 5px 5px 0 0;
  transition: height 0.5s ease;
  position: relative;
}

.chart-bar-primary {
  background: linear-gradient(to top, #ff6b6b, #ff9999);
}

.chart-bar-secondary {
  background: linear-gradient(to top, #4ecdc4, #7dd3d8);
}

.chart-bar-label {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
}

.chart-bar-value {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
  color: white;
}

/* ==========================================================================
   INTERACTIVE ELEMENTS
   ========================================================================== */

.control-group {
  margin-bottom: 1.5rem;
}

.control-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #e0e0e0;
}

.control-note {
  font-size: 0.9rem;
  color: rgba(224, 224, 224, 0.6);
  font-style: italic;
  margin-top: 0.5rem;
}

.simulation-controls {
  margin: 2rem 0;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.results-box {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border-left: 4px solid #4ecdc4;
}

/* Status indicators */
.status-pending { color: #e0e0e0; }
.status-failed { color: #ff6b6b; font-weight: bold; }
.status-success { color: #50fa7b; font-weight: bold; }
.status-warning { color: #f1c40f; font-weight: bold; }

/* ==========================================================================
   TIMELINE COMPONENT
   ========================================================================== */

.timeline {
  margin-top: 4rem;
  text-align: center;
}

.timeline-slider-container {
  position: relative;
  width: 100%;
  padding: 1rem 0;
  margin-top: 2rem;
}

.timeline-slider {
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
  border-radius: 5px;
}

.timeline-points {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
}

.timeline-point {
  width: 20px;
  height: 20px;
  background-color: #e0e0e0;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid #0a0a0a;
}

.timeline-point:hover {
  transform: scale(1.5);
  background-color: #4ecdc4;
}

.timeline-point.active {
  background-color: #ff6b6b;
  transform: scale(1.6);
  box-shadow: 0 0 15px rgba(255, 107, 107, 0.7);
}

.timeline-details {
  margin-top: 3rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-left: 4px solid #ff6b6b;
  border-radius: 8px;
  min-height: 150px;
  text-align: left;
  transition: all 0.5s ease;
}

.timeline-details h4 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #ff6b6b;
}

/* ==========================================================================
   NETWORK DIAGRAM (for PageRank-style visualizations)
   ========================================================================== */

.network-diagram {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 500px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 20%;
  place-items: center;
}

.network-node {
  position: static;
  width: 80px;
  height: 80px;
  border: 3px solid #4ecdc4;
  border-radius: 50%;
  background: rgba(78, 205, 196, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  transition: all 0.3s ease;
  cursor: pointer;
  z-index: 10;
}

.network-node.active {
  background: rgba(255, 107, 107, 0.4);
  border-color: #ff6b6b;
  transform: scale(1.2);
  box-shadow: 0 0 25px rgba(255, 107, 107, 0.5);
}

/* ==========================================================================
   PROGRESS BARS
   ========================================================================== */

.progress-container {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  padding: 20px;
}

.progress-bar {
  display: flex;
  align-items: center;
  margin: 15px 0;
}

.progress-label {
  width: 60px;
  font-weight: bold;
}

.progress-track {
  flex: 1;
  height: 25px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  margin: 0 15px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ecdc4, #45b7d1);
  border-radius: 12px;
  transition: width 0.5s ease;
  width: 0%;
}

.progress-value {
  min-width: 50px;
  text-align: right;
  font-weight: bold;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.hidden {
  display: none !important;
}

.invisible {
  opacity: 0;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 15px; }
.rounded-full { border-radius: 50%; }

.shadow { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); }
.shadow-lg { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); }

/* Color utilities */
.text-primary { color: #4ecdc4; }
.text-secondary { color: #ff6b6b; }
.text-accent { color: #45b7d1; }
.text-muted { color: rgba(224, 224, 224, 0.6); }

.bg-primary { background-color: #4ecdc4; }
.bg-secondary { background-color: #ff6b6b; }
.bg-dark { background: rgba(255, 255, 255, 0.05); }

/* ==========================================================================
   ANIMATIONS & LOADERS
   ========================================================================== */

.loader {
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top: 3px solid #ff6b6b;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-left: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-up {
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

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

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  .section {
    padding: 40px 20px;
  }
  
  .hero-content p {
    font-size: 1.1rem;
  }
  
  .stats-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .simulation-controls {
    flex-direction: column;
    align-items: center;
  }
  
  .btn-large {
    padding: 15px 30px;
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }
  
  .section {
    padding: 30px 15px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .panel {
    padding: 1.5rem;
  }
}