:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --accent-color: #4a90e2;
  --card-bg: #f8f9fa;
  --border-color: #e0e0e0;
}

[data-theme="dark"] {
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --accent-color: #6ab0ff;
  --card-bg: #1e1e1e;
  --border-color: #333333;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

header {
  background: linear-gradient(135deg, var(--accent-color), #357abd);
  color: white;
  padding: 60px 20px;
  text-align: center;
  position: relative;
}

header h1 {
  margin: 0;
  font-size: 2.5rem;
}

header p {
  font-size: 1.2rem;
  opacity: 0.9;
}

.back-home {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s ease;
}

.back-home:hover {
  background: rgba(255, 255, 255, 0.4);
}

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

.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.card h2 {
  color: var(--accent-color);
  border-bottom: 3px solid var(--accent-color);
  padding-bottom: 10px;
  margin-top: 0;
}

ol,
ul {
  padding-left: 25px;
}

li {
  margin-bottom: 15px;
}

.demo {
  margin: 20px 0;
  padding: 20px;
  background: var(--bg-color);
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  text-align: center;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-color);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

select {
  padding: 10px 15px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-color);
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.image-gallery img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.image-gallery img:hover {
  transform: scale(1.05);
}

footer {
  text-align: center;
  padding: 30px;
  background: var(--card-bg);
  margin-top: 50px;
  border-top: 1px solid var(--border-color);
}

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

  .card {
    padding: 20px;
  }

  .image-gallery {
    grid-template-columns: 1fr;
  }

  .back-home {
    position: static;
    display: inline-block;
    margin-bottom: 20px;
  }
}
