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

:root {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

/* Dark theme (default) */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #e0e0e0;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
  width: 100%;
  overflow-x: hidden;
}

header {
  background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
  color: #ff9800;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid #ff9800;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
  width: 100%;
}

header.hide {
  transform: translateY(-100%);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.logo {
  height: 40px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(255, 152, 0, 0.5));
  transition: filter 0.3s ease;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ff9800;
  transition: color 0.3s ease;
  flex-grow: 1;
  min-width: 0;
}

.theme-toggle {
  margin-left: auto;
  background: none;
  border: 2px solid #ff9800;
  color: #ff9800;
  font-size: 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: #ff9800;
  color: #1a1a1a;
  transform: scale(1.1);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

nav a {
  color: #e0e0e0;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  display: inline-block;
}

nav a:hover {
  background: #ff9800;
  color: #1a1a1a;
  transform: translateY(-2px);
}

section {
  padding: 3rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  background: #2d2d2d;
  margin: 2rem auto;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  border-left: 4px solid #ff9800;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  width: 100%;
  max-width: calc(100% - 4rem);
}

section h2 {
  color: #ff9800;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  border-bottom: 3px solid #ff9800;
  padding-bottom: 0.5rem;
  display: inline-block;
  transition: color 0.3s ease, border-color 0.3s ease;
}

section h3 {
  color: #ffb333;
  font-size: 1.3rem;
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  transition: color 0.3s ease;
}

section ul {
  margin-left: 1.5rem;
}

section li {
  margin-bottom: 0.8rem;
  font-size: 1.05rem;
  color: #e0e0e0;
  transition: color 0.3s ease;
}

section img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 2px solid #ff9800;
}

section img:hover {
  transform: scale(1.02);
}

section a {
  color: #ff9800;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
  border-bottom: 2px solid transparent;
}

section a:hover {
  color: #ffb333;
  border-bottom: 2px solid #ffb333;
}

section p {
  color: #e0e0e0;
  transition: color 0.3s ease;
}

footer {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  color: #e0e0e0;
  text-align: center;
  padding: 2.5rem;
  margin-top: 2rem;
  box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.3);
  border-top: 3px solid #ff9800;
  transition: background 0.3s ease, border-color 0.3s ease;
  width: 100%;
}

footer a {
  color: #ff9800;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border-bottom: 2px solid rgba(255, 152, 0, 0.3);
}

footer a:hover {
  color: #ffb333;
  border-bottom: 2px solid #ffb333;
}

/* Light theme */
html[data-theme="light"] body {
  color: #333;
  background: linear-gradient(135deg, #f0f4f8 0%, #e8eff5 100%);
}

html[data-theme="light"] header {
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  color: #27ae60;
  border-bottom: 3px solid #27ae60;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] header h1 {
  color: #27ae60;
}

html[data-theme="light"] .theme-toggle {
  border-color: #27ae60;
  color: #27ae60;
}

html[data-theme="light"] .theme-toggle:hover {
  background: #27ae60;
  color: white;
}

html[data-theme="light"] nav a {
  color: #333;
}

html[data-theme="light"] nav a:hover {
  background: #27ae60;
  color: white;
}

html[data-theme="light"] section {
  background: white;
  border-left: 4px solid #27ae60;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] section h2 {
  color: #27ae60;
  border-bottom: 3px solid #27ae60;
}

html[data-theme="light"] section h3 {
  color: #229954;
}

html[data-theme="light"] section li {
  color: #333;
}

html[data-theme="light"] section img {
  border: 2px solid #27ae60;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] section a {
  color: #27ae60;
}

html[data-theme="light"] section a:hover {
  color: #229954;
  border-bottom: 2px solid #229954;
}

html[data-theme="light"] section p {
  color: #333;
}

html[data-theme="light"] footer {
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  color: #333;
  border-top: 3px solid #27ae60;
  box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] footer a {
  color: #27ae60;
  border-bottom: 2px solid rgba(39, 174, 96, 0.3);
}

html[data-theme="light"] footer a:hover {
  color: #229954;
  border-bottom: 2px solid #229954;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  html, body {
    width: 100%;
    overflow-x: hidden;
    max-width: 100vw;
  }

  header {
    padding: 0.8rem;
    width: 100%;
    max-width: 100%;
  }

  .header-content {
    gap: 0.3rem;
    flex-wrap: nowrap;
  }

  header h1 {
    font-size: 1.3rem;
    flex-grow: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .logo {
    height: 30px;
    flex-shrink: 0;
  }

  .theme-toggle {
    font-size: 1rem;
    padding: 0.3rem 0.5rem;
    flex-shrink: 0;
    border-width: 1px;
  }

  nav {
    width: 100%;
  }

  nav ul {
    gap: 0.3rem;
    justify-content: center;
  }

  nav a {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }

  section {
    padding: 1.5rem 1rem;
    margin: 1rem auto;
    max-width: 100%;
    width: calc(100vw - 2rem);
    border-radius: 5px;
  }

  section h2 {
    font-size: 1.3rem;
  }

  section h3 {
    font-size: 1rem;
  }

  section li {
    font-size: 0.95rem;
  }

  footer {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
  }

  footer p {
    font-size: 0.9rem;
  }
}
