/* Dr. Yogesh Shepal Website - Main Stylesheet */

/* CSS Variables */
:root {
  --primary: #007bff;
  --dark: #1e1e2f;
  --light: #f8f9fa;
  --text: #333;
}

/* Global Styles */
* {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  display: flex;
  background: #eaf0fa;
  color: #222;
}

/* Animations */
@keyframes spin { 
  100% { transform: rotate(360deg); } 
}

@keyframes blink {
  0%, 50% { border-color: var(--primary); }
  51%, 100% { border-color: transparent; }
}

@keyframes pulse {
  0% { transform: scale(1.3); box-shadow: 0 4px 12px rgba(255,193,7,0.5); }
  50% { transform: scale(1.5); box-shadow: 0 6px 16px rgba(255,193,7,0.7); }
  100% { transform: scale(1.3); box-shadow: 0 4px 12px rgba(255,193,7,0.5); }
}

/* Section Styles */
section {
  padding: 60px 20px;
  max-width: 1000px;
  margin: auto;
  display: block;
  visibility: visible;
  opacity: 1;
}

section h2 {
  color: var(--primary);
  margin-bottom: 20px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 5px;
}

/* About Section */
.about img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  border: 4px solid var(--primary);
  margin-bottom: 20px;
}

.about p {
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 700px;
  margin: auto;
}

/* Resume Section */
.resume a {
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
}

/* Card Styles */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.card {
  background: transparent;
  perspective: 1000px;
  height: 200px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.card:hover .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-back {
  background: linear-gradient(135deg, var(--primary), #0056b3);
  color: white;
  transform: rotateY(180deg);
}

.card-back h4 {
  margin: 0 0 10px 0;
  font-size: 1.1rem;
}

.card-back p {
  font-size: 0.9rem;
  margin: 5px 0;
}

/* Timeline Styles */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 0;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 6px;
  background: linear-gradient(180deg, var(--primary) 0%, #0056b3 100%);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -3px;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
}

.timeline-item {
  padding: 15px 50px;
  position: relative;
  background: inherit;
  width: 50%;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.timeline-item.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  right: -12px;
  background: linear-gradient(135deg, var(--primary), #0056b3);
  border: 5px solid #fff;
  top: 20px;
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
  transition: all 0.3s ease;
}

.timeline-item:hover::after {
  transform: scale(1.2);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.6);
}

.timeline-left {
  left: 0;
}

.timeline-right {
  left: 50%;
}

.timeline-right::after {
  left: -12px;
}

.timeline-content {
  padding: 25px 35px;
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  position: relative;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 123, 255, 0.1);
  transition: all 0.3s ease;
  overflow: hidden;
}

.timeline-content::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #0056b3);
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
  border-color: var(--primary);
}

.timeline-left .timeline-content::before {
  content: '';
  position: absolute;
  top: 25px;
  right: -12px;
  border: 12px solid transparent;
  border-left-color: #fff;
  z-index: 1;
}

.timeline-right .timeline-content::before {
  content: '';
  position: absolute;
  top: 25px;
  left: -12px;
  border: 12px solid transparent;
  border-right-color: #fff;
  z-index: 1;
}

.timeline-year {
  color: var(--primary);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-year::before {
  content: '📅';
  font-size: 1rem;
}

.timeline-title {
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-title::before {
  content: '🎓';
  font-size: 1.1rem;
}

.timeline-content p {
  color: #555;
  line-height: 1.6;
  margin: 0;
  font-size: 1rem;
}

.timeline-institution {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}

.timeline-description {
  color: #666;
  font-style: italic;
}

.timeline-duration {
  background: var(--primary);
  color: white;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  margin-right: 6px;
  display: inline-block;
  white-space: nowrap;
}

/* Slider Styles */
.slider-container {
  width: 100%;
  max-width: 1000px;
  height: 350px;
  margin: auto;
  background: var(--dark);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  overflow: hidden;
  position: relative;
}

.slider {
  display: flex;
  transition: transform 0.6s cubic-bezier(.77,0,.18,1);
  height: 350px;
  touch-action: pan-x;
}

.slide {
  flex: 0 0 50%;
  height: 350px;
  object-fit: contain;
  background: transparent;
  border-right: 2px solid #eee;
}

.slide:last-child {
  border-right: none;
}

.prev, .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  font-size: 2rem;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 50%;
  z-index: 2;
}

.prev { left: 10px; }
.next { right: 10px; }

.slider-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.slider-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #bbb;
  cursor: pointer;
  border: none;
  outline: none;
  transition: background 0.3s;
}

.slider-dot.active {
  background: var(--primary);
}

/* Footer */
footer {
  text-align: center;
  padding: 40px 20px 40px 20px;
  background: #0056b3;
  color: #fff;
  border-radius: 0 0 12px 12px;
  margin-top: 40px;
}

/* Material Card */
.material-card {
  max-width: 600px;
  margin: 30px auto;
  padding: 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: 2px solid var(--primary);
}

.material-card h4 {
  color: var(--primary);
  margin-top: 0;
}

.material-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.material-list li {
  margin-bottom: 16px;
}

.material-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.material-table td, .material-table th {
  padding: 8px;
  border: 1px solid #ddd;
}

.material-table th {
  background: #f0f4fa;
  color: var(--primary);
}

/* Sidebar Styles */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #007bff 0%, #0056b3 100%);
  color: #fff;
  min-height: 100vh;
  padding: 0;
  box-shadow: 2px 0 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
}

.sidebar-header {
  text-align: center;
  padding: 32px 10px 16px 10px;
}

.sidebar-img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid #fff;
  object-fit: contain;
  margin-bottom: 10px;
  background: #fff;
}

.sidebar h2 {
  margin: 10px 0 4px 0;
  font-size: 1.3rem;
  font-weight: 700;
}

.sidebar p {
  margin: 0 0 16px 0;
  font-size: 1rem;
  font-weight: 400;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 0 8px;
}

.sidebar nav a {
  color: #fff;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  font-size: 0.95rem;
}

.sidebar nav a:last-child {
  margin-bottom: 12px;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: #fff;
  color: #007bff;
}

.main-content {
  margin-left: 260px;
  width: calc(100% - 260px);
  min-height: 100vh;
  padding-bottom: 0;
  display: block;
  visibility: visible;
  opacity: 1;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 101;
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* Quiz Styles */
.quiz-option {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  padding: 15px;
  margin: 8px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  line-height: 1.4;
}

.quiz-option:hover {
  background: #e3f2fd;
  border-color: var(--primary);
  transform: translateX(5px);
}

.quiz-option.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateX(5px);
}

/* Tool Modal Styles */
#toolModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

#toolContent {
  background: white;
  border-radius: 12px;
  padding: 30px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.close-tool {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #666;
  z-index: 1001;
}

.close-tool:hover {
  color: #dc3545;
}

/* Learning Tools Grid */
.learning-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.tool-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 25px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.25);
}

.tool-card h3 {
  margin: 0 0 10px 0;
  font-size: 1.3rem;
}

.tool-card p {
  margin: 0;
  opacity: 0.9;
  font-size: 0.95rem;
}

/* Code Editor Styles */
.code-editor {
  width: 100%;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.4;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #1e1e1e;
  color: #f8f8f2;
  resize: vertical;
}

.output-panel {
  background: #1e1e1e;
  color: #0f0;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  padding: 15px;
  border-radius: 8px;
  overflow-y: auto;
  white-space: pre-wrap;
  border: 1px solid #333;
}

/* Experiment Card Styles */
.experiment-card {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.experiment-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.experiment-card h4 {
  margin: 0 0 10px 0;
  font-size: 1.1rem;
}

.experiment-card p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-toggle {
    display: block;
  }
  
  .main-content {
    margin-left: 0;
    width: 100%;
    padding-top: 20px;
  }
  
  .sidebar-overlay.show {
    display: block;
  }
  
  /* Timeline Mobile */
  .timeline::after {
    left: 20px;
  }
  
  .timeline-item {
    width: 100%;
    padding-left: 50px;
    padding-right: 20px;
  }
  
  .timeline-item::after {
    left: 8px;
  }
  
  .timeline-left .timeline-content::before,
  .timeline-right .timeline-content::before {
    left: -12px;
    border-left-color: transparent;
    border-right-color: #fff;
  }
  
  .timeline-right {
    left: 0;
  }
  
  /* Cards Mobile */
  .cards {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .card {
    height: auto;
    min-height: 150px;
  }
  
  /* Slider Mobile */
  .slider-container {
    height: 200px;
  }
  
  .slide {
    flex: 0 0 100%;
    height: 200px;
  }
  
  .slider {
    height: 200px;
  }
  
  /* Tool Modal Mobile */
  #toolModal {
    padding: 10px;
  }
  
  #toolContent {
    padding: 20px;
    max-width: 100%;
    max-height: 95vh;
  }
  
  /* Learning Tools Mobile */
  .learning-tools {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .tool-card {
    padding: 20px;
  }
  
  /* Quiz Mobile */
  .quiz-option {
    padding: 12px;
    font-size: 0.95rem;
  }
  
  /* Code Editor Mobile */
  .code-editor {
    font-size: 12px;
    padding: 10px;
  }
  
  .output-panel {
    font-size: 11px;
    padding: 10px;
  }
  
  /* Experiment Grid Mobile */
  .experiment-card {
    padding: 15px;
  }
  
  .experiment-card h4 {
    font-size: 1rem;
  }
  
  .experiment-card p {
    font-size: 0.85rem;
  }
  
  /* Algorithm Visualizer Mobile */
  #visualizer {
    height: 300px !important;
  }
  
  #pseudocodePanel {
    height: 250px !important;
    font-size: 11px;
  }
  
  /* Data Structure Visualizer Mobile */
  #dsVisualization {
    height: 300px !important;
  }
  
  /* Virtual Lab Mobile */
  #experimentArea {
    min-height: 250px;
    padding: 15px;
  }
  
  /* Material Card Mobile */
  .material-card {
    margin: 20px 10px;
    padding: 20px;
  }
  
  /* Section Mobile */
  section {
    padding: 40px 15px;
  }
  
  section h2 {
    font-size: 1.5rem;
  }
  
  /* About Mobile */
  .about img {
    width: 120px;
    height: 120px;
  }
  
  .about p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  /* Extra small screens */
  .sidebar {
    width: 240px;
  }
  
  .sidebar h2 {
    font-size: 1.1rem;
  }
  
  .sidebar p {
    font-size: 0.9rem;
  }
  
  .sidebar-img {
    width: 70px;
    height: 70px;
  }
  
  .timeline-content {
    padding: 20px;
  }
  
  .timeline-title {
    font-size: 1.1rem;
  }
  
  .card-front, .card-back {
    padding: 15px;
  }
  
  .tool-card h3 {
    font-size: 1.1rem;
  }
  
  .tool-card p {
    font-size: 0.9rem;
  }
  
  #toolContent {
    padding: 15px;
  }
  
  .quiz-option {
    padding: 10px;
    font-size: 0.9rem;
  }
  
  .code-editor {
    font-size: 11px;
  }
  
  .output-panel {
    font-size: 10px;
  }
  
  section {
    padding: 30px 10px;
  }
  
  .about img {
    width: 100px;
    height: 100px;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .quiz-option {
    padding: 18px;
    margin: 10px 0;
  }
  
  .tool-card {
    padding: 30px;
  }
  
  .experiment-card {
    padding: 20px;
  }
  
  button {
    padding: 12px 20px;
    font-size: 1rem;
  }
  
  .sidebar nav a {
    padding: 15px 12px;
  }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
  .sidebar {
    width: 220px;
  }
  
  .main-content {
    padding-top: 20px;
  }
  
  #toolContent {
    max-height: 85vh;
  }
  
  #visualizer {
    height: 250px !important;
  }
  
  #pseudocodePanel {
    height: 200px !important;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .sidebar-img {
    image-rendering: -webkit-optimize-contrast;
  }
  
  .about img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Back to Top Button */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,123,255,0.3);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

#backToTop:hover {
  background: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,123,255,0.4);
}

/* Print styles */
@media print {
  .sidebar {
    display: none;
  }
  
  .main-content {
    margin-left: 0;
    width: 100%;
  }
  
  .sidebar-toggle {
    display: none;
  }
  
  #toolModal {
    display: none !important;
  }
  
  #backToTop {
    display: none !important;
  }
}

/* Additional Sidebar Styles */
.sidebar-toggle {
  color: white;
  border: none;
  padding: 10px;
  border-radius: 5px;
  font-size: 1.2rem;
  cursor: pointer;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; 
  left: 0;
  width: 100vw; 
  height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

.sidebar.open ~ .sidebar-overlay {
  display: block;
}

/* Card Section Styles */
.card-section, .material-card, section {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 30px;
  padding: 30px 24px;
}

.card-section h2, section h2 {
  color: #0056b3;
  margin-bottom: 18px;
  border-bottom: 2px solid #007bff;
  padding-bottom: 5px;
}

/* Research Paper Styles */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

.research-paper {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  border-left: 4px solid var(--primary);
  transition: all 0.3s ease;
  position: relative;
}

.research-paper:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.paper-year {
  position: absolute;
  top: -8px;
  right: 15px;
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.research-paper h4 {
  color: #2c3e50;
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  line-height: 1.4;
}

.paper-journal {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.paper-description {
  color: #666;
  line-height: 1.5;
  margin-bottom: 15px;
  font-size: 0.9rem;
}

.paper-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.metric {
  background: #e9ecef;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #495057;
}

/* Blog Section Styles */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.blog-post {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  border-left: 4px solid var(--primary);
  transition: all 0.3s ease;
}

.blog-post:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.blog-date {
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 15px;
}

.blog-post h3 {
  color: #2c3e50;
  margin: 0 0 15px 0;
  font-size: 1.3rem;
  line-height: 1.4;
}

.blog-excerpt p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
}

.read-more-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.3s ease;
}

.read-more-btn:hover {
  background: #0056b3;
}

.blog-content {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.blog-content h4 {
  color: var(--primary);
  margin: 20px 0 10px 0;
  font-size: 1.1rem;
}

.blog-content p {
  color: #555;
  line-height: 1.7;
  margin-bottom: 15px;
}

.blog-content ul {
  color: #555;
  line-height: 1.6;
  margin: 10px 0;
}

.blog-content pre {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 15px;
  overflow-x: auto;
  font-size: 0.85rem;
  margin: 15px 0;
}

.blog-content code {
  font-family: 'Courier New', monospace;
  color: #333;
}

/* Learning Tools Styles */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.tool-card {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  border-top: 4px solid var(--primary);
  transition: all 0.3s ease;
}

.tool-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.tool-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.tool-card h3 {
  color: #2c3e50;
  margin: 0 0 10px 0;
  font-size: 1.3rem;
}

.tool-card p {
  color: #666;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.tool-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.tool-btn:hover {
  background: #0056b3;
  transform: scale(1.05);
}

/* Tool Modal Styles */
.tool-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.8);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-modal-content {
  background: white;
  border-radius: 15px;
  width: 90vw;
  height: 80vh;
  position: relative;
  overflow: hidden;
}

.tool-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  cursor: pointer;
  z-index: 2001;
  color: #666;
}

#toolContent {
  width: 100%;
  height: 100%;
  padding: 50px 20px 20px 20px;
  overflow-y: auto;
}

/* Code Editor Styles */
.code-editor {
  width: 100%;
  height: 300px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #1e1e1e;
  color: #fff;
  resize: vertical;
  line-height: 1.4;
  tab-size: 4;
}

.code-editor:focus {
  outline: 2px solid var(--primary);
  border-color: var(--primary);
}

.output-panel {
  background: #000;
  color: #0f0;
  padding: 15px;
  border-radius: 8px;
  font-family: monospace;
  min-height: 200px;
  overflow-y: auto;
}

/* Quiz Styles */
.quiz-option {
  display: block;
  margin: 10px 0;
  padding: 10px;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quiz-option:hover {
  background: #e9ecef;
  border-color: var(--primary);
}

.quiz-option.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Array Bar Styles */
.array-bar {
  transition: all 0.4s ease;
  font-size: 12px;
  font-weight: bold;
  border: 1px solid rgba(255,255,255,0.3);
}

.array-bar.comparing {
  background: #ffc107 !important;
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(255,193,7,0.4);
}

.array-bar.swapping {
  background: #dc3545 !important;
  transform: scale(1.2);
  box-shadow: 0 6px 12px rgba(220,53,69,0.4);
}

.array-bar.selected {
  background: #28a745 !important;
  transform: scale(1.15);
  box-shadow: 0 5px 10px rgba(40,167,69,0.4);
}

/* Graph Node Styles */
.graph-node {
  transition: all 0.4s ease;
  cursor: pointer;
}

.graph-node.visited {
  background: #28a745 !important;
  transform: scale(1.3);
  box-shadow: 0 4px 12px rgba(40,167,69,0.5);
}

.graph-node.current {
  background: #ffc107 !important;
  animation: pulse 1.5s infinite;
}

/* String Character Styles */
.string-char {
  transition: all 0.3s ease;
  cursor: pointer;
}

.string-char.comparing {
  background: #ffc107 !important;
  border-color: #ffc107 !important;
  transform: scale(1.1);
}

.string-char.selected {
  background: #28a745 !important;
  color: white !important;
  border-color: #28a745 !important;
}

.string-char.swapping {
  background: #dc3545 !important;
  color: white !important;
  border-color: #dc3545 !important;
}

/* Experiment Card Styles */
.experiment-card {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border: 2px solid #e9ecef;
  border-radius: 10px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.experiment-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.experiment-card h4 {
  margin: 0 0 8px 0;
  color: #2c3e50;
  font-size: 1rem;
}

.experiment-card p {
  margin: 0;
  color: #666;
  font-size: 0.85rem;
}

/* Dark Mode Styles */
.dark-mode {
  background: #181a1b !important;
  color: #eee !important;
}

.dark-mode .sidebar {
  background: linear-gradient(180deg, #222 0%, #333 100%) !important;
  color: #fff !important;
}

.dark-mode section, .dark-mode .material-card, .dark-mode .card {
  background: #222 !important;
  color: #eee !important;
}

.dark-mode footer {
  background: #222 !important;
  color: #eee !important;
}

/* Animation Classes */
.animate-on-scroll {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.animate-slide-left {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-slide-left.animate-in {
  opacity: 1;
  transform: translateX(0);
}

.animate-slide-right {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-slide-right.animate-in {
  opacity: 1;
  transform: translateX(0);
}

.animate-scale {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-scale.animate-in {
  opacity: 1;
  transform: scale(1);
}

/* Tabbed Interface Styles */
.tabs-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  overflow: hidden;
}

.tabs-nav {
  display: flex;
  background: #f8f9fa;
  border-bottom: 1px solid #ddd;
}

.tab-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
}

.tab-btn:hover {
  background: #e9ecef;
  color: #333;
}

.tab-btn.active {
  background: #fff;
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  padding: 24px;
  display: none;
}

.tab-content.active {
  display: block;
}

.unit-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.unit-card:hover {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.unit-title {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.unit-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.unit-btn {
  padding: 6px 12px;
  border: none;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.download-btn {
  background: var(--primary);
  color: #fff;
}

.preview-btn {
  background: #28a745;
  color: #fff;
}

.unit-btn:hover {
  background: #0056b3;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Toast Notification Styles */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2001;
  pointer-events: none;
}

.toast {
  background: #28a745;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  margin-bottom: 10px;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 280px;
  pointer-events: auto;
}

.toast.show {
  transform: translateX(0);
}

.toast.error {
  background: #dc3545;
}

.toast.info {
  background: #17a2b8;
}

.toast-icon {
  font-size: 18px;
}

.toast-message {
  flex: 1;
  font-size: 14px;
}

.toast-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  margin-left: 8px;
}

/* Typewriter Animation Styles */
.typewriter {
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 700px;
  margin: auto;
  min-height: 60px;
}

.typewriter-text {
  border-right: 2px solid var(--primary);
  animation: blink 1s infinite;
}

.typing-complete .typewriter-text {
  border-right: none;
  animation: none;
}

/* Data Structure Visualizer Styles */
.ds-tab-btn {
  padding: 10px 20px;
  border: none;
  background: #f0f0f0;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.ds-tab-btn.active {
  background: #007bff;
  color: white;
}

.ds-tab-btn:hover {
  background: #0056b3;
  color: white;
}

.ds-tab-content {
  display: none;
}

.ds-tab-content.active {
  display: block;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .getAlgorithmVisualizer() div[style*="grid-template-columns: 1fr 350px"] {
    grid-template-columns: 1fr !important;
  }
  #pseudocodePanel {
    height: 300px !important;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 280px;
    left: -280px;
    transition: left 0.3s ease;
    box-shadow: 2px 0 12px rgba(0,0,0,0.15);
  }
  .sidebar.open {
    left: 0;
  }
  .sidebar-toggle {
    display: block;
  }
  .main-content {
    margin-left: 0;
    width: 100%;
    min-height: 100vh;
    padding-bottom: 0;
    display: block;
    visibility: visible;
    opacity: 1;
  }
  section {
    padding: 40px 15px;
  }
  .timeline {
    padding: 20px 0;
  }
  .research-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .slider-container, .slider {
    max-width: 100vw;
    height: 250px;
  }
  .slide {
    flex: 0 0 100%;
    height: 250px;
    object-fit: contain;
  }
}

@media (max-width: 768px) {
  .timeline::after {
    left: 35px;
    width: 4px;
    margin-left: -2px;
  }
  .timeline-item {
    width: 100%;
    padding-left: 80px;
    padding-right: 25px;
  }
  .timeline-item::after {
    left: 23px;
    width: 20px;
    height: 20px;
  }
  .timeline-right {
    left: 0%;
  }
  .timeline-right .timeline-content::before {
    left: -10px;
    border-right-color: #fff;
    border-left-color: transparent;
    border-width: 10px;
  }
  .timeline-left .timeline-content::before {
    left: -10px;
    border-right-color: #fff;
    border-left-color: transparent;
    border-width: 10px;
  }
  .timeline-duration {
    display: inline-block;
    margin-right: 4px;
    font-size: 0.6rem;
    padding: 1px 4px;
    white-space: nowrap;
  }
  .research-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .research-paper {
    padding: 20px;
    margin: 0 5px;
  }
  .research-paper h4 {
    font-size: 1rem;
    margin-right: 60px;
  }
  .paper-metrics {
    gap: 8px;
  }
  .metric {
    font-size: 0.75rem;
    padding: 3px 6px;
  }
  .tool-modal-content {
    width: 95vw;
    height: 90vh;
  }
  .tools-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
  }
  .tabs-nav {
    flex-wrap: wrap;
  }
  .tab-btn {
    flex: 1;
    min-width: 100px;
    font-size: 13px;
    padding: 10px 8px;
  }
  .tab-content {
    padding: 20px 15px;
  }
  .unit-card {
    padding: 15px;
    margin-bottom: 15px;
  }
  .unit-actions {
    flex-direction: column;
    gap: 6px;
  }
  .unit-btn {
    width: 100%;
    padding: 8px 12px;
  }
  .toast-container {
    top: 60px;
    right: 10px;
    left: 10px;
  }
  .toast {
    min-width: auto;
    width: 100%;
    transform: translateX(0);
  }
  .toast.show {
    transform: translateX(0);
  }
  #backToTop {
    bottom: 20px !important;
    right: 20px !important;
    width: 45px !important;
    height: 45px !important;
    font-size: 1.3rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    text-align: center !important;
  }
}

@media (max-width: 500px) {
  .slider-container, .slider {
    width: 100%;
    height: 200px;
  }
  .slide {
    flex: 0 0 100%;
    height: 200px;
    object-fit: contain;
  }
}
/* Quiz Option Styles */
.quiz-option {
    display: block;
    margin: 10px 0;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    line-height: 1.4;
}

.quiz-option:hover {
    background: #e9ecef;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.quiz-option.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}
