/* Brownian Motion & Random Walk Visualization Styles */

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 100%);
  color: #e0e0e0;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* Header */
header {
  text-align: center;
  padding: 30px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 15px;
  margin-bottom: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
  font-size: 2.5em;
  font-weight: 300;
  color: #4ecdc4;
  margin-bottom: 10px;
  text-shadow: 0 0 20px rgba(78, 205, 196, 0.3);
}

.subtitle {
  font-size: 1.1em;
  color: #a0a0b0;
  max-width: 800px;
  margin: 0 auto;
}

/* Mode Tabs */
.mode-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  justify-content: center;
}

.mode-tab {
  padding: 12px 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.3s ease;
}

.mode-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.mode-tab.active {
  background: linear-gradient(135deg, #4ecdc4 0%, #45b7d1 100%);
  border-color: #4ecdc4;
  color: #ffffff;
  font-weight: 600;
}

/* Visualization Section */
.visualization-section {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 30px;
  margin-bottom: 30px;
}

.canvas-container {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

#mainCanvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
}

#mainCanvas:active {
  cursor: grabbing;
}

.canvas-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 20px;
}

.overlay-info {
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 15px;
  border-radius: 5px;
  font-size: 0.9em;
  color: #4ecdc4;
}

.overlay-info strong {
  color: #ffffff;
  margin-left: 5px;
}

/* Control Panel */
.control-panel {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 15px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-height: 600px;
  overflow-y: auto;
}

.control-panel::-webkit-scrollbar {
  width: 8px;
}

.control-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.control-panel::-webkit-scrollbar-thumb {
  background: rgba(78, 205, 196, 0.5);
  border-radius: 4px;
}

.control-group {
  margin-bottom: 25px;
}

.control-group h3 {
  font-size: 1.1em;
  color: #4ecdc4;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(78, 205, 196, 0.3);
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}

.control-row label {
  font-size: 0.9em;
  color: #b0b0c0;
  flex: 1;
}

.control-row input[type="range"] {
  flex: 2;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.control-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #4ecdc4;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.control-row input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

.control-row span {
  min-width: 50px;
  text-align: right;
  font-size: 0.9em;
  color: #ffffff;
  font-weight: 600;
}

.control-group select {
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 0.9em;
  cursor: pointer;
  outline: none;
}

.control-group select:focus {
  border-color: #4ecdc4;
  box-shadow: 0 0 10px rgba(78, 205, 196, 0.2);
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  font-size: 0.9em;
  color: #b0b0c0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.checkbox-group label:hover {
  color: #e0e0e0;
}

.checkbox-group input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  accent-color: #4ecdc4;
  cursor: pointer;
}

/* Buttons */
.button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #45b7d1 0%, #3da4bc 100%);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(69, 183, 209, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #4ecdc4 0%, #3db8b0 100%);
  color: #ffffff;
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, #f7b731 0%, #e5a62a 100%);
  color: #ffffff;
}

.btn-warning:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(247, 183, 49, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #a0a0b0 0%, #9090a0 100%);
  color: #ffffff;
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(160, 160, 176, 0.4);
}

.shortcut {
  font-size: 0.75em;
  opacity: 0.7;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

/* Statistics Section */
.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(78, 205, 196, 0.2);
  border-color: rgba(78, 205, 196, 0.3);
}

.stat-card h3 {
  font-size: 0.9em;
  color: #b0b0c0;
  margin-bottom: 10px;
  font-weight: 500;
}

.stat-value {
  font-size: 2em;
  font-weight: 700;
  color: #4ecdc4;
  text-shadow: 0 0 20px rgba(78, 205, 196, 0.3);
}

.stat-note {
  font-size: 0.8em;
  color: #a0a0b0;
  margin-top: 5px;
}

/* Charts Section */
.charts-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.chart-container {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
}

.chart-container h3 {
  font-size: 1.1em;
  color: #4ecdc4;
  margin-bottom: 15px;
  font-weight: 500;
}

.chart-container canvas {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 10px;
}

.chart-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  font-size: 0.85em;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-item .color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.legend-item.empirical .color {
  background: rgba(78, 205, 196, 0.7);
}

.legend-item.theoretical .color {
  background: #ff6b6b;
}

.legend-item.simulated .color {
  background: #4ecdc4;
}

.legend-item.theory .color {
  background: rgba(255, 255, 255, 0.5);
}

.chart-stats {
  text-align: center;
  font-size: 0.85em;
  color: #b0b0c0;
  margin-top: 10px;
}

.chart-stats strong {
  color: #4ecdc4;
}

/* Finance Section */
.finance-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 30px;
}

.finance-section h2 {
  font-size: 1.8em;
  color: #4ecdc4;
  margin-bottom: 20px;
  font-weight: 300;
}

.finance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.finance-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(78, 205, 196, 0.2);
  border-radius: 10px;
  padding: 15px;
  text-align: center;
}

.finance-card h3 {
  font-size: 0.85em;
  color: #b0b0c0;
  margin-bottom: 8px;
  font-weight: 500;
}

.finance-value {
  font-size: 1.8em;
  font-weight: 700;
  color: #4ecdc4;
}

.option-pricing {
  margin-top: 20px;
}

.option-pricing h3 {
  font-size: 1.2em;
  color: #4ecdc4;
  margin-bottom: 15px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.option-card {
  background: rgba(78, 205, 196, 0.05);
  border: 1px solid rgba(78, 205, 196, 0.2);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}

.option-card h4 {
  font-size: 1em;
  color: #ffffff;
  margin-bottom: 10px;
}

.option-value {
  font-size: 2em;
  font-weight: 700;
  color: #4ecdc4;
  margin-bottom: 10px;
}

.option-params {
  font-size: 0.85em;
  color: #b0b0c0;
}

/* Analysis Section */
.analysis-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 30px;
}

.analysis-section h2 {
  font-size: 1.8em;
  color: #4ecdc4;
  margin-bottom: 20px;
  font-weight: 300;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.analysis-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
}

.analysis-card h3 {
  font-size: 1.1em;
  color: #4ecdc4;
  margin-bottom: 15px;
  font-weight: 500;
}

.formula-box {
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid #4ecdc4;
  padding: 12px 15px;
  margin: 10px 0;
  font-family: 'Courier New', monospace;
  font-size: 0.95em;
  color: #e0e0e0;
  overflow-x: auto;
}

.formula-box p {
  margin: 5px 0;
}

.formula-note {
  font-size: 0.85em;
  color: #a0a0b0;
  font-style: italic;
}

.note {
  font-size: 0.85em;
  color: #a0a0b0;
  margin-top: 10px;
  line-height: 1.5;
}

.analysis-card ul {
  list-style: none;
  padding-left: 0;
}

.analysis-card ul li {
  padding: 8px 0;
  color: #b0b0c0;
  font-size: 0.9em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.analysis-card ul li:last-child {
  border-bottom: none;
}

.analysis-card ul li strong {
  color: #4ecdc4;
}

/* Education Section */
.education-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 30px;
}

.tab-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #b0b0c0;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
}

.tab-btn.active {
  background: linear-gradient(135deg, #4ecdc4 0%, #45b7d1 100%);
  border-color: #4ecdc4;
  color: #ffffff;
  font-weight: 600;
}

.tab-content {
  display: block;
  width: 100%;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.tab-pane h3 {
  font-size: 1.5em;
  color: #4ecdc4;
  margin-bottom: 20px;
  font-weight: 400;
}

.tab-pane h4 {
  font-size: 1.2em;
  color: #ffffff;
  margin: 25px 0 15px 0;
  font-weight: 500;
}

.tab-pane p {
  color: #b0b0c0;
  line-height: 1.8;
  margin-bottom: 15px;
}

.tab-pane ul {
  list-style: none;
  padding-left: 0;
}

.tab-pane ul li {
  padding: 8px 0;
  color: #b0b0c0;
  padding-left: 20px;
  position: relative;
}

.tab-pane ul li:before {
  content: "•";
  color: #4ecdc4;
  font-weight: bold;
  position: absolute;
  left: 0;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline:before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #4ecdc4 0%, #45b7d1 100%);
}

.timeline-item {
  position: relative;
  margin-bottom: 30px;
}

.timeline-year {
  position: absolute;
  left: -40px;
  top: 0;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #4ecdc4 0%, #45b7d1 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75em;
  font-weight: 700;
  color: #ffffff;
}

.timeline-content {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  margin-left: 10px;
}

.timeline-content h4 {
  color: #4ecdc4;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.timeline-content p {
  color: #b0b0c0;
  line-height: 1.6;
}

/* Theory Sections */
.theory-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.info-box {
  background: rgba(78, 205, 196, 0.05);
  border: 1px solid rgba(78, 205, 196, 0.2);
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
}

.info-box h4 {
  color: #4ecdc4;
  margin-bottom: 10px;
  font-size: 1em;
}

.info-box p {
  color: #b0b0c0;
  margin: 8px 0;
}

/* Experiment Cards */
.experiment-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.experiment-card h4 {
  color: #4ecdc4;
  margin-bottom: 10px;
}

.experiment-card p {
  color: #b0b0c0;
  margin-bottom: 15px;
}

.experiment-steps {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 15px;
}

.experiment-steps ol {
  margin-left: 20px;
}

.experiment-steps li {
  color: #b0b0c0;
  margin: 10px 0;
  line-height: 1.6;
}

/* Finance Education */
.finance-edu-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.finance-edu-section h4 {
  color: #4ecdc4;
  margin-bottom: 12px;
  font-size: 1.1em;
}

/* Application Cards */
.application-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 15px;
}

.application-card h4 {
  color: #4ecdc4;
  margin-bottom: 10px;
}

.application-card p {
  color: #b0b0c0;
  line-height: 1.6;
  margin-bottom: 10px;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  color: #a0a0b0;
  font-size: 0.9em;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .visualization-section {
    grid-template-columns: 1fr;
  }

  .charts-section {
    grid-template-columns: 1fr;
  }

  .stats-section {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.8em;
  }

  .subtitle {
    font-size: 1em;
  }

  .mode-tabs {
    flex-direction: column;
  }

  .button-group {
    grid-template-columns: 1fr;
  }

  .tab-nav {
    flex-direction: column;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
  }
}

/* Loading Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
