/* --- CSS Lesson Polished Styles --- */
:root {
  --primary: #06b6d4; /* CSS cyan/teal */
  --primary-dark: #0e7490;
  --secondary: #f0fdfa;
  --dark: #1e293b;
  --light: #f8fafc;
  --accent: #22d3ee;
  --sidebar-width: 250px;
  --code-bg: #f0fdfa;
  --code-border: #a7f3d0;
}

/* Subtle gradient background for CSS lessons */
body {
  background: linear-gradient(120deg, #f8fafc 0%, #f0fdfa 100%);
  color: var(--dark);
  position: relative;
  min-height: 100vh;
  font-size: 1.06em;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: css-fadein 0.7s;
}

@keyframes css-fadein {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Content Box - Card style with CSS accent */
.content-box {
  background-color: white;
  border-radius: 12px;
  padding: 36px;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.07);
  margin-bottom: 30px;
  border-left: 6px solid var(--primary);
  transition: box-shadow 0.3s, transform 0.3s;
}
.content-box:hover {
  box-shadow: 0 8px 32px rgba(6, 182, 212, 0.13);
  transform: translateY(-2px) scale(1.01);
}

/* Code Example Styling for CSS */
.code-example {
  background-color: var(--code-bg);
  border-radius: 10px;
  border-left: 4px solid var(--accent);
  padding: 20px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(34, 211, 238, 0.07);
}
.code-header {
  color: #0e7490;
}
.code-content {
  font-family: "Fira Mono", "Courier New", Courier, monospace;
  line-height: 1.7;
  color: #0e7490;
  font-size: 1.04em;
}
.code-tag {
  color: #06b6d4;
}
.code-attr {
  color: #0e7490;
}
.code-string {
  color: #059669;
}

/* Subtopics Section for CSS Lessons */
.subtopics-section {
  margin: 22px 0 14px 0;
  background: #f0fdfa;
  border-radius: 10px;
  padding: 14px 20px;
  animation: subtopics-fadein 0.6s;
  box-shadow: 0 1px 6px rgba(6, 182, 212, 0.06);
}
@keyframes subtopics-fadein {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.subtopics-section h3 {
  margin-top: 0;
  font-size: 1.13em;
  color: #0e7490;
  letter-spacing: 0.7px;
}
.subtopic {
  margin-bottom: 8px;
}
.subtopic-toggle {
  background: #ccfbf1;
  border: 1px solid #67e8f9;
  color: #0e7490;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 5px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.2s, border 0.2s, box-shadow 0.2s;
  min-height: 44px;
  font-size: 1.04em;
  box-shadow: 0 1px 2px rgba(6, 182, 212, 0.03);
}
.subtopic-toggle.open,
.subtopic-toggle:hover {
  background: #67e8f9;
  border: 1.5px solid #06b6d4;
  outline: 2px solid #06b6d4;
  outline-offset: 1px;
}
.subtopic-content {
  background: #fff;
  border-left: 3px solid #06b6d4;
  margin-top: 4px;
  margin-bottom: 10px;
  padding: 9px 13px;
  border-radius: 0 8px 8px 0;
  font-size: 1em;
  box-shadow: 0 1px 4px rgba(6, 182, 212, 0.06);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .content-box {
    padding: 18px;
    font-size: 0.99em;
  }
  .subtopics-section {
    padding: 10px 6px;
    font-size: 0.98em;
  }
  .sidebar {
    position: fixed;
    left: -260px;
    top: 52px;
    width: 240px;
    height: calc(100vh - 52px);
    z-index: 1000;
    background: #fff;
    transition: left 0.3s;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
    border-right: 1px solid #67e8f9;
  }
  .sidebar.active {
    left: 0;
  }
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 20px;
    max-width: 100vw;
  }
  .menu-toggle {
    display: flex !important;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
  }
}

/* Ensure .menu-toggle is hidden by default */
.menu-toggle {
  display: none;
}

/* Hamburger menu toggle for mobile */
.menu-toggle {
  display: none;
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  z-index: 200;
  border: none;
  outline: none;
  transition: background 0.2s;
}
.menu-toggle:hover,
.menu-toggle:focus {
  background: var(--primary-dark);
}
.menu-toggle svg {
  width: 28px;
  height: 28px;
  display: block;
  stroke: white;
}

@media (max-width: 600px) {
  body {
    font-size: 0.98em;
  }
  .content-box {
    padding: 8px;
    font-size: 0.97em;
    margin-bottom: 16px;
  }
  .subtopics-section {
    padding: 6px 2px;
    font-size: 0.97em;
    border-radius: 6px;
  }
  .subtopic-toggle {
    font-size: 0.97em;
    padding: 10px 8px;
    min-height: 40px;
  }
  .subtopic-content {
    padding: 7px 6px;
    font-size: 0.97em;
  }
}
