/* Reset y configuración base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

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

/* Header */
.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  padding: 2rem 0;
  text-align: center;
  margin-bottom: 2rem;
}

.header h1 {
  font-size: 2.5rem;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.header p {
  color: #7f8c8d;
  font-size: 1.2rem;
}

/* Main content */
.main {
  padding: 2rem 0;
}

/* Introducción */
.intro {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.intro h2 {
  color: #2c3e50;
  font-size: 2rem;
  margin-bottom: 1rem;
  text-align: center;
}

.intro p {
  color: #555;
  margin-bottom: 2rem;
  text-align: center;
  font-size: 1.1rem;
}

.intro code {
  background: #f0f0f0;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: "Courier New", monospace;
  color: #e74c3c;
}

.coordinate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.coordinate-item {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 1.5rem;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.coordinate-item h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.coordinate-item p {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Ejercicios */
.exercise {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.exercise h2 {
  color: #2c3e50;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  border-bottom: 3px solid #667eea;
  padding-bottom: 0.5rem;
}

.exercise p {
  color: #555;
  margin-bottom: 1.5rem;
}

.exercise ul {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
}

.exercise li {
  margin-bottom: 0.5rem;
  color: #555;
}

/* Áreas de demostración */
.demo-area {
  border: 3px dashed #667eea;
  padding: 2rem;
  margin: 1.5rem 0;
  min-height: 200px;
  background: #f8f9fa;
  border-radius: 10px;
  position: relative;
}

/* Cajas de ejemplo */
.box {
  width: 100px;
  height: 80px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border-radius: 10px;
  margin: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  font-size: 0.8rem;
  text-align: center;
}

.box:hover {
  transform: scale(1.05);
}

/* Relative con coordenadas */
.relative-box {
  position: relative;
}

.top-20 {
  top: 20px;
  background: linear-gradient(135deg, #3498db, #2980b9);
}

.left-30 {
  left: 30px;
  background: linear-gradient(135deg, #e67e22, #d35400);
}

.top-20-left-30 {
  top: 20px;
  left: 30px;
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.bottom-20-right-30 {
  bottom: 20px;
  right: 30px;
  background: linear-gradient(135deg, #1abc9c, #16a085);
}

/* Absolute con coordenadas */
.absolute-demo {
  position: relative;
  height: 300px;
}

.absolute-box {
  position: absolute;
}

.corner {
  width: 100px;
  height: 60px;
}

.top-left {
  top: 0;
  left: 0;
  background: linear-gradient(135deg, #3498db, #2980b9);
}

.top-right {
  top: 0;
  right: 0;
  background: linear-gradient(135deg, #e67e22, #d35400);
}

.bottom-left {
  bottom: 0;
  left: 0;
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.bottom-right {
  bottom: 0;
  right: 0;
  background: linear-gradient(135deg, #1abc9c, #16a085);
}

.center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #f39c12, #e67e22);
  width: 120px;
  height: 80px;
}

.middle-left {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  width: 100px;
  height: 60px;
}

.middle-right {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #34495e, #2c3e50);
  width: 100px;
  height: 60px;
}

/* Fixed elements */
.fixed-element {
  position: fixed;
  width: 80px;
  height: 60px;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  font-size: 0.7rem;
}

.top-left-fixed {
  top: 20px;
  left: 20px;
  background: linear-gradient(135deg, #3498db, #2980b9);
}

.top-right-fixed {
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #e67e22, #d35400);
}

.center-fixed {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.bottom-left-fixed {
  bottom: 20px;
  left: 20px;
  background: linear-gradient(135deg, #1abc9c, #16a085);
}

.bottom-right-fixed {
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #34495e, #2c3e50);
}

/* Centrado con diferentes métodos */
.centering-demo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.centering-method {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
}

.centering-method h3 {
  color: #2c3e50;
  margin-bottom: 1rem;
  text-align: center;
}

.demo-container {
  position: relative;
  height: 200px;
  border: 2px dashed #667eea;
  border-radius: 10px;
  background: white;
  margin: 1rem 0;
}

.centered-box {
  width: 100px;
  height: 60px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.method1 {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.method2 {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -30px;
  margin-left: -50px;
}

.method3 {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: auto;
}

/* Layout demo */
.layout-demo {
  border: 3px solid #27ae60;
  border-radius: 10px;
  overflow: hidden;
  margin: 1.5rem 0;
  min-height: 400px;
  position: relative;
}

.layout-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  z-index: 1001;
}

.layout-nav {
  position: sticky;
  top: 60px;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(135deg, #34495e, #2c3e50);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  z-index: 1000;
}

.layout-sidebar {
  position: fixed;
  top: 100px;
  left: 0;
  bottom: 60px;
  width: 200px;
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.layout-main {
  position: relative;
  top: 100px;
  left: 200px;
  right: 0;
  bottom: 60px;
  background: white;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #2c3e50;
}

.layout-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  z-index: 1001;
}

.layout-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: white;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-weight: bold;
  box-shadow: 0 5px 20px rgba(243, 156, 18, 0.4);
  z-index: 1002;
  cursor: pointer;
  transition: all 0.3s ease;
}

.layout-button:hover {
  transform: scale(1.1);
}

/* Profile card */
.profile-card {
  position: relative;
  width: 300px;
  height: 200px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 15px;
  padding: 2rem;
  margin: 2rem auto;
  color: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.profile-avatar {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.status-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #27ae60;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: bold;
}

.profile-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.profile-info h3 {
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.profile-info p {
  margin-bottom: 0.3rem;
  opacity: 0.9;
  font-size: 0.9rem;
}

.follow-button {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.follow-button:hover {
  background: white;
  color: #667eea;
}

/* Ejemplos de código */
.code-example {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 1.5rem;
  border-radius: 10px;
  margin: 1.5rem 0;
}

.code-example h3 {
  color: #3498db;
  margin-bottom: 1rem;
}

.code-example pre {
  background: #34495e;
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
}

.code-example code {
  background: none;
  color: #ecf0f1;
  padding: 0;
}

/* Footer */
.footer {
  background: rgba(44, 62, 80, 0.95);
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: 3rem;
}

.btn-back {
  display: inline-block;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  margin-top: 1rem;
  transition: all 0.3s ease;
}

.btn-back:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
  .header h1 {
    font-size: 2rem;
  }

  .exercise {
    padding: 1.5rem;
  }

  .demo-area {
    padding: 1rem;
  }

  .box {
    width: 80px;
    height: 60px;
    font-size: 0.7rem;
  }

  .corner {
    width: 80px;
    height: 50px;
  }

  .centering-demo {
    grid-template-columns: 1fr;
  }

  .layout-sidebar {
    width: 150px;
  }

  .layout-main {
    left: 150px;
  }

  .profile-card {
    width: 280px;
    height: 180px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 10px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .exercise h2 {
    font-size: 1.5rem;
  }

  .box {
    width: 70px;
    height: 50px;
    font-size: 0.6rem;
    margin: 5px;
  }

  .corner {
    width: 70px;
    height: 40px;
  }

  .layout-sidebar {
    width: 100px;
  }

  .layout-main {
    left: 100px;
  }

  .profile-card {
    width: 250px;
    height: 160px;
    padding: 1.5rem;
  }
}
