/* transform.css - Styles for CSS Transform Example Page */

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f8f9fa;
  color: #222;
  margin: 0;
  padding: 0;
}

.back-btn {
  display: inline-block;
  margin-top: 24px;
  padding: 10px 22px;
  background: linear-gradient(90deg, #3498db 60%, #8e44ad 100%);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 2px 8px 0 rgba(52, 152, 219, 0.12);
  transition: color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.back-btn:hover {
  color: #ffd200;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px 0 rgba(52, 152, 219, 0.2);
}
main {
  max-width: 900px;
  margin: 2rem auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(52,152,219,0.08);
  padding: 2rem 2.5vw;
}
header h1 {
  margin-top: 0;
  color: #3498db;
  font-size: 2.2rem;
  letter-spacing: 0.02em;
}
section.theory {
  background: #f0f6ff;
  border-left: 4px solid #3498db;
  padding: 1.2rem 1.5rem;
  margin-bottom: 2rem;
  border-radius: 8px;
}
section.code-demo {
  margin-bottom: 2rem;
}
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.demo-card {
  background: #f9f9fb;
  border: 1px solid #e0e6ed;
  border-radius: 8px;
  padding: 1rem 1rem 1.5rem 1rem;
  box-shadow: 0 2px 8px rgba(52,152,219,0.04);
  margin-bottom: 1rem;
  transition: box-shadow 0.3s, transform 0.3s;
}
.demo-card:hover {
  box-shadow: 0 6px 24px 0 #8e44ad33;
  transform: translateY(-4px) scale(1.03);
}
.demo-card h3 {
  margin-top: 0;
  color: #8e44ad;
  font-size: 1.1rem;
}
.box {
  width: 120px;
  height: 48px;
  background: #3498db;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin: 0.5rem 0 1rem 0;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(52,152,219,0.08);
  transition: none;
}
.translate-demo,
.scale-demo,
.rotate-demo,
.skew-demo {
  transition: transform 0.4s;
}

.translate-demo:hover {
  transform: translate(40px, -20px);
}

.scale-demo:hover {
  transform: scale(1.3);
}

.rotate-demo:hover {
  transform: rotate(-18deg);
}

.skew-demo:hover {
  transform: skew(20deg, 5deg);
}
.combo-demo {
  transition: transform 0.5s cubic-bezier(.4,1.6,.4,1);
}
.combo-demo:hover {
  transform: scale(1.2) rotate(8deg) translateY(-18px);
}
.perspective-demo {
  transition: transform 0.6s cubic-bezier(.4,1.6,.4,1);
  perspective: 300px;
}
.perspective-demo:hover {
  transform: rotateY(40deg) scale(1.1);
}
.origin-demo {
  transition: transform 0.5s;
  transform-origin: left bottom;
}
.origin-demo:hover {
  transform: rotate(-30deg) scale(1.1);
}
.matrix-demo {
  transition: transform 0.5s;
}
.matrix-demo:hover {
  transform: matrix(1, 0.3, 0.3, 1, 20, -10);
}
.rotatex-demo {
  transition: transform 0.6s cubic-bezier(.4,1.6,.4,1);
  perspective: 300px;
}
.rotatex-demo:hover {
  transform: rotateX(50deg) scale(1.1);
}
.img-demo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0 1rem 0;
}
.img-transform-demo {
  width: 100%;
  max-width: 220px;
  border-radius: 10px;
  transition: transform 0.5s cubic-bezier(.4,1.6,.4,1), filter 0.5s;
  box-shadow: 0 2px 12px 0 #3498db22;
}
.img-transform-demo:hover {
  transform: scale(1.18) rotate(-6deg);
  filter: brightness(1.1) contrast(1.1);
  box-shadow: 0 8px 32px 0 #8e44ad44;
}
pre {
  background: #222;
  color: #fff;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  font-size: 0.98rem;
  overflow-x: auto;
  margin: 0.5rem 0 0 0;
  border: 1.5px solid #8e44ad22;
  box-shadow: 0 1px 4px 0 #8e44ad11;
}
.note {
  color: #8e44ad;
  font-size: 1rem;
  margin-top: 1.2rem;
  font-style: italic;
}
@media (max-width: 600px) {
  main {
    padding: 1rem 2vw;
  }
  .demo-grid {
    grid-template-columns: 1fr;
  }
  .box {
    width: 100%;
    min-width: 0;
  }
}
