/* transitions.css - Styles for CSS Transitions 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;
}
.basic-transition {
  transition: background-color 0.5s;
}

.multi-transition {
  transition: width 0.5s, background-color 0.5s;
}
.basic-transition:hover, .multi-transition:hover  {
  background-color: rgba(142, 68, 173, 0.6);
}
.multi-transition:hover {
  width: 220px;
}
.timing-demo {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.timing-demo .box {
  width: 80px;
  height: 40px;
  font-size: 0.95rem;
  margin: 0.2rem 0;
}
.timing-ease {
  transition: transform 0.6s ease;
}
.timing-linear {
  transition: transform 0.6s linear;
}
.timing-ease-in {
  transition: transform 0.6s ease-in;
}
.timing-ease-out {
  transition: transform 0.6s ease-out;
}
.timing-ease-in-out {
  transition: transform 0.6s ease-in-out;
}
.timing-demo .box:hover {
  transform: scale(1.2);
}
.delay-demo {
  transition: background 0.5s ease 0.5s;
}
.delay-demo:hover {
  background: #f7971e;
}
.all-demo {
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.all-demo:hover {
  background: #ffd200;
  color: #222;
  border-radius: 50px;
  width: 220px;
}
.fade-demo {
  transition: opacity 0.6s;
}
.fade-demo:hover {
  opacity: 0.3;
}
.radius-demo {
  transition: border-radius 0.5s;
}
.radius-demo:hover {
  border-radius: 50%;
}
.shadow-demo {
  transition: box-shadow 0.4s;
}
.shadow-demo:hover {
  box-shadow: 0 8px 32px 0 #8e44ad;
}
.steps-demo {
  transition: background 1s steps(4);
}
.steps-demo:hover {
  background: #e74c3c;
}
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;
}
.img-demo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0 1rem 0;
}
.img-transition-demo {
  width: 100%;
  max-width: 220px;
  border-radius: 10px;
  transition: transform 0.5s cubic-bezier(0.4, 1.6, 0.4, 1), filter 0.5s, box-shadow 0.5s;
  filter: brightness(0.95) contrast(1);
  box-shadow: 0 2px 12px 0 #3498db22;
}
.img-transition-demo:hover {
  transform: scale(1.13) rotate(-2deg);
  filter: brightness(1.15) contrast(1.1);
  box-shadow: 0 8px 32px 0 #8e44ad44;
}
@media (max-width: 600px) {
  main {
    padding: 1rem 2vw;
  }
  .demo-grid {
    grid-template-columns: 1fr;
  }
  .box {
    width: 100%;
    min-width: 0;
  }
}
