/* --- General Reset and Base Styles --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #031930;
    color: #0d95f6;
    line-height: 1.6;
}

/* --- Header and Navigation (Mobile First) --- */
header {
    background-color: #00030f;
    color: white;
    padding: 0.5rem 10px;
    display: flex;
    /*flex-direction: column; /* Stack logo and nav vertically on small screens */
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    justify-content: space-between;
    margin-right:0;
    width:100%;
    z-index: 999;
}

header h3 {
    margin-bottom: 11px; /* Space below the title on mobile */
    font-size: 1rem;
    padding-left:5px;
}
/* Sidebar styles */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 220px;
  height: 100%;
  margin-top: 0;
  background-color: #0d0e47;
  color: #fff;
  padding: 10px;
  padding-left:10px;
  transition: left 0.3s;
  overflow:scroll;
  z-index: 9999;
}

.sidebar h2 {
  text-align: center;
  margin-bottom: 20px;
}

.sidebar .menu {
  list-style: none;
  padding-left:0;
}

.sidebar .menu li {
  margin: 5px 0;
  background: #044d5fb0;
}

.sidebar .menu a {
  text-decoration: none;
  color: #fff;
  display: block;
  padding: 10px;
  border-radius: 8px;
  transition:  0.3s;
}

.sidebar .menu a:hover {
  background-color: #333;
}
.sidebar .menu ul{
    margin-left:0;
}
/*nav-link navbar*/
nav{
    width:100%;
    padding:5px;
    position: relative;
}
nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    width:100%;
    flex-wrap: nowrap; /* Allow links to wrap to the next line */
    justify-content: left;
    overflow: hidden;
    overflow-x: scroll;
    background: none;
    /*box-shadow:0 0 10px #aaaaaa;*/
    position:relative;
}
.question label {
    padding:5px;
    background:#fff;
    margin:5px;
    padding-top:8px;
    border-radius:8px;
}
.question label input {position: relative; margin-top:10px;}
.question label code {
    position: relative;
    bottom:5px;
}
nav ul li {
    margin: 5px 5px; /* Smaller margins for compact mobile navigation */
}

nav ul li a {
    color: #0b2adc;
    text-decoration: none;
    font-weight: 400;
    padding: 5px 0;
    display: block; /* Make links block level for easier tapping */
}

nav ul li a:hover {
    color: #ec9712;
}

/* --- Main Content Area --- */
.main-content {
    padding: 20px; /* Reduced padding for mobile */
    max-width: 900px;
    margin: 20px auto;
    background-color: rgba(1, 2, 7, 0.37);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    color: #0d95f6;
}

hr {
    border: 0;
    height: 1px;
    background-color: #e9ecef;
    margin: 30px 0;
}
.question label button{
    background:none;
    width:100px;
    margin:5px;
    text-align:left;
    padding:5px;
}
.quiz-question{
    display:none;
}
.section-title {
    color: #007bff;
    border-bottom: 2px solid #fcb502bd /*#007bff*/;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.5rem; /* Slightly smaller for mobile */
}

/* Informational Box Styling */
.info-box {
    background-color: #191b1d;
    border-left: 5px solid #fcb502bd;
    padding: 3px;
    margin-top: 5px;
    border-radius: 4px;
}
.info-box span{
    font-size: 20px;
}
pre code{border-left: 5px solid #ffd10054;border-radius:4px;/*box-shadow:0 0 10px #aaaaaa;*/}
.quiz-box{
    background-color: #1d1f20;
    border: none;/*2px solid #007bff;*/ 
    padding: 10px;
    margin-top: 20px;
    border-radius: 4px;
}
/* --- Code Display Area --- */
.code-example {
    background-color: #272822;
    color: #f8f8f2; 
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto; /* Essential: Allows horizontal scrolling for long code lines */
    margin: 15px 0;
}

.code-example code {
    white-space: pre; /* Prevents code from wrapping unnecessarily */
    font-family: 'Consolas', 'Monaco', monospace;
    color: #e6db74;
}

/* --- Call-to-Action Button --- */
.cta-button {
    background-color: #28a745;
    color: white;
    border: none;margin: 5px;
    padding: 12px 20px; /* Adjusted padding */
    font-size: 1rem;
    cursor: pointer; 
    border-radius: 5px;
    font-weight: 700;
    transition: background-color 0.3s, transform 0.2s;
    width: auto; /* Full width button on small screens */
    box-sizing: border-box; /* Include padding/border in width calculation */
}
input{
  padding: 10px;
  
}
.cta-button:hover {
    background-color: #218838;
    transform: none; /* Removed subtle animation for mobile to avoid accidental triggering */
}
.hdh1{
    color:#0c07a3;
}
.hdh1 b{
    color:#ffc107;
}
span{color:#f72ae2;}
.a-button{
    text-decoration:none;
    padding:8px;
    background:#00ccff50;
    border:1px solid #00ccff;
    color:#00ccff;
    margin:10px;
    border-radius:5px;
    font-weight:700;
}
/* --- Footer --- */
footer {
    text-align: center;
    padding: 15px;
    background-color: #343a40;
    color: #adb5bd;
    font-size: 0.85rem;
    margin-left: 225px;
    transition:left 0.3s;
}
header, .main-content, footer {
    margin-left: 235px;
    transition: left 0.3s;
}
#toggle-btn {
  display: none;
  font-size: 24px;
  color: #1a1a1a;
  cursor: pointer;
}
.quiz-box form label{background: none;}
/* ========================================================= */
/* --- MEDIA QUERY for Tablets and Desktops (Min Width 768px) --- */
/* ========================================================= */
@media (min-width: 768px) {
    
    /* Revert Header/Nav to a horizontal layout */
    header {
        padding: 1.5rem 10px;
    }

    header h3 {
        margin-bottom: 0;
        font-size: 2.2rem;
    }

    nav ul li {
        margin: 8px;
    }
    /* Adjust main content area padding */
    main {
        padding: 40px;
        margin: 0;
    }

    .section-title {
        font-size: 2rem;
    }
    
    /* Make the CTA button smaller and center it */
    .cta-button {
        width: auto; /* Revert to natural size */
        display: inline-block;
        padding: 12px 25px;
        font-size: 1.1rem;
    }
    
    .cta-button:hover {
        transform: translateY(-2px); /* Re-enable subtle animation for desktop */
    }
}

/* Responsive: collapse sidebar on small screens */
@media (max-width: 768px) {
  header{margin-left: 0;}
  .sidebar {
    left: -245px;
    /*display: none;*/
  }

  .sidebar.active {
    left: 0;
  }

  .main-content {
    margin-left: 5px;
  }
  footer{
      margin-left:0;
  }
  #toggle-btn {
    display: block;
  }
}
