/* Base Reset & Layout */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}
.nav-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.nav-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* Nav control base sizing */
.nav-text {
  font-size: 25px;
  transition: font-size 0.3s ease;
}

.nav-icon {
  width: 30px;
  transition: width 0.3s ease, filter 0.2s ease, opacity 0.2s ease;
}

.header {
    transition: padding 0.3s ease, border-radius 0.3s ease;
}   

.header h1 {
    transition: font-size 0.3s ease;
}

.header.shrink {
    padding: 10px 30px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;   /* smaller vertical padding */
}

.header.shrink h1 {
    font-size: 1em;     /* smaller title */
}


.header.shrink .nav-text {
  font-size: 18px;
}

.header.shrink .nav-icon {
  width: 20px;
}

/* Hover effect: make it lighter */
.nav-btn:hover img {
  filter: brightness(1.5);  
  opacity: 0.8;
}
.container {
    max-width: 90%;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Typography */
.header {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;

    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}
.disabledbtn {
  opacity: 0.6;
  cursor: not-allowed;
}
/* Style the second line */
.nav-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px; /* Space between buttons and section text */
}
.header h1 { font-size: 2.5em; margin-bottom: 10px; }
.content { padding: 40px; line-height: 1.8; font-size: 1.1em; color: #333; }
.content h1, .content h2 { margin-top: 1.5em; color: #2d3748; }
.content h1 { border-bottom: 3px solid #667eea; padding-bottom: 10px; }
.content p { margin-bottom: 1em; }

/* Inline Code */
.content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', monospace;
    color: #e83e8c;
    font-size: 0.9em;
}

/* Static Code Blocks */
.content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5em 0;
    font-family: 'Consolas', monospace;
}
.content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Interactive Blocks */
.runnable-block {
    background: #1e1e1e;
    border-radius: 8px;
    margin: 1.5em 0;
    overflow: hidden;
    border: 1px solid #444;
}
.runnable-header {
    background: #2d2d2d;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
}
.runnable-header span { color: #aaa; font-size: 0.85em; font-family: sans-serif; }

.run-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85em;
    transition: background 0.2s;
}
.run-button:hover { background: #764ba2; }
.run-button:disabled { background: #555; cursor: wait; }

/* CodeMirror Overrides */
.CodeMirror { height: auto; min-height: 80px; font-family: 'Consolas', monospace; font-size: 14px; }

/* Console Output */
.console-output {
    background: #151515;
    color: #ccc;
    padding: 15px;
    font-family: 'Consolas', monospace;
    font-size: 0.9em;
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid #333;
    white-space: pre-wrap;
}
.console-output:empty::before { content: 'Run code to see output...'; color: #555; font-style: italic; }
.console-output .log { color: #ccc; }
.console-output .error { color: #ff6b6b; }

/* Loading State */
.loading-overlay { text-align: center; padding: 40px; color: #667eea; font-weight: bold; }