/* Main Styling for Plate Tectonics Presentation */

:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --background-color: #ecf0f1;
  --text-color: #333;
  --light-text: #fff;
  --earth-blue: #1a73e8;
  --earth-green: #34a853;
  --earth-brown: #b06f41;
  --transition-speed: 0.5s;
}

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

body {
  font-family: 'Roboto', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  overflow-x: hidden;
}

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

header {
  background-color: var(--primary-color);
  color: var(--light-text);
  padding: 20px 0;
  text-align: center;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

h2 {
  font-size: 2rem;
  margin: 30px 0 15px;
  color: var(--primary-color);
}

h3 {
  font-size: 1.5rem;
  margin: 20px 0 10px;
  color: var(--secondary-color);
}

p {
  margin-bottom: 15px;
}

.section {
  margin: 40px 0;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Navigation */
.nav-controls {
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
}

.nav-button {
  padding: 10px 20px;
  background-color: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.nav-button:hover {
  background-color: #2980b9;
}

.nav-button:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
}

/* Animation Container */
.animation-container {
  position: relative;
  width: 100%;
  height: 500px;
  margin: 30px 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--earth-blue);
}

/* Timeline Control */
.timeline-control {
  width: 100%;
  padding: 20px 0;
}

.timeline-slider {
  width: 100%;
  margin-bottom: 10px;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--primary-color);
}

/* Pangaea Animation Styles */
.continent {
  position: absolute;
  background-color: var(--earth-green);
  transition: all 2s ease-in-out;
}

.pangaea {
  width: 60%;
  height: 40%;
  top: 30%;
  left: 20%;
  background-color: var(--earth-brown);
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

/* North America */
.north-america {
  width: 20%;
  height: 25%;
  top: 20%;
  left: 15%;
  clip-path: polygon(0% 20%, 40% 0%, 100% 0%, 80% 60%, 100% 100%, 60% 100%, 20% 80%, 0% 60%);
}

/* South America */
.south-america {
  width: 15%;
  height: 25%;
  top: 45%;
  left: 25%;
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

/* Africa */
.africa {
  width: 20%;
  height: 30%;
  top: 35%;
  left: 45%;
  clip-path: polygon(0% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%);
}

/* Eurasia */
.eurasia {
  width: 30%;
  height: 25%;
  top: 20%;
  left: 45%;
  clip-path: polygon(0% 20%, 20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%);
}

/* Australia */
.australia {
  width: 12%;
  height: 15%;
  top: 60%;
  left: 75%;
  clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
}

/* Antarctica */
.antarctica {
  width: 15%;
  height: 15%;
  top: 75%;
  left: 45%;
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

/* Plate Boundary Animation Styles */
.boundary-container {
  position: relative;
  width: 100%;
  height: 300px;
  margin: 20px 0;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.plate {
  position: absolute;
  height: 100px;
  background-color: #795548;
  border-top: 5px solid #5d4037;
}

.left-plate {
  width: 50%;
  left: 0;
  bottom: 100px;
}

.right-plate {
  width: 50%;
  right: 0;
  bottom: 100px;
}

.mantle {
  position: absolute;
  width: 100%;
  height: 100px;
  bottom: 0;
  background: linear-gradient(to bottom, #ff9800, #f44336);
}

.ocean {
  position: absolute;
  width: 100%;
  height: 100px;
  top: 0;
  background-color: rgba(26, 115, 232, 0.7);
}

.mountain {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-bottom: 60px solid #795548;
  bottom: 200px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
}

.volcano {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-bottom: 40px solid #795548;
  bottom: 200px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
}

.lava {
  position: absolute;
  width: 4px;
  height: 0;
  background-color: #f44336;
  bottom: 240px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
}

.fault-line {
  position: absolute;
  width: 4px;
  height: 100px;
  background-color: #f44336;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
}

/* Animation Controls */
.controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}

.control-button {
  padding: 8px 16px;
  background-color: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.control-button:hover {
  background-color: #2980b9;
}

.control-button.active {
  background-color: var(--accent-color);
}

/* Info Boxes */
.info-box {
  padding: 15px;
  margin: 15px 0;
  background-color: rgba(52, 152, 219, 0.1);
  border-left: 4px solid var(--secondary-color);
  border-radius: 4px;
}

.info-box h4 {
  margin-bottom: 8px;
  color: var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
  .animation-container {
    height: 400px;
  }
  
  .controls {
    flex-direction: column;
    align-items: center;
  }
  
  .control-button {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .animation-container {
    height: 300px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.2rem;
  }
}

/* Animation Keyframes */
@keyframes drift {
  0% {
    transform: translateX(0) translateY(0);
  }
  100% {
    transform: translateX(var(--drift-x)) translateY(var(--drift-y));
  }
}

@keyframes converge {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(var(--converge-distance));
  }
}

@keyframes diverge {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(var(--diverge-distance));
  }
}

@keyframes transform-slide {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(var(--transform-distance));
  }
}

@keyframes rise {
  0% {
    height: 0;
    opacity: 0;
  }
  100% {
    height: var(--rise-height);
    opacity: 1;
  }
}

@keyframes erupt {
  0% {
    height: 0;
  }
  50% {
    height: 40px;
  }
  100% {
    height: 0;
  }
}

@keyframes earthquake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

/* Print Styles */
@media print {
  .animation-container, .controls, .nav-controls {
    display: none;
  }
  
  body {
    background-color: white;
    color: black;
  }
  
  .section {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
  
  h1, h2, h3 {
    page-break-after: avoid;
  }
  
  p, img {
    page-break-inside: avoid;
  }
}