body {
    margin: 0;
    padding: 0;
    background-color: #f0f0f0; /* Fallback background */
    overflow-x: hidden;
    //overflow: hidden; /* Prevent scrollbars caused by grid extending slightly */
}

.tooltip-container {
    position: relative; /* Establishes a positioning context for the tooltip */
    display: inline-block; /* Allows container to sit inline but contain positioned elements */
}

.tooltip-trigger {
    cursor: help; /* Changes cursor to indicate help is available */
    text-decoration: underline dotted; /* Visually indicates interactivity */
    color: var(--accent-color); /* Optional: make the word stand out */
}

.tooltip-text {
    visibility: hidden; /* Hide the tooltip by default */
    opacity: 0; /* Start fully transparent */
    width: 200px; /* Set a width for the tooltip */
    background-color: var(--bg-color); /* Dark background */
    color: var(--text-color) /* White text */
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute; /* Position relative to the container */
    z-index: 1; /* Ensure it appears above other content */
    bottom: 125%; /* Position above the trigger word */
    left: 50%; /* Center horizontally */
    margin-left: -100px; /* Offset by half its width to truly center */
    transition:
        opacity 0.3s ease,
        visibility 0s linear 0.3s; /* Smooth fade-in, instant hide on fade-out completion */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 0.9em; /* Slightly smaller font */
    text-decoration: none; /* Remove underline from tooltip text itself */
    line-height: 1.4; /* Adjust line height within tooltip */
}

/* Show the tooltip on hover */
.tooltip-container:hover .tooltip-text {
    visibility: visible; /* Make it visible */
    opacity: 1; /* Make it fully opaque */
    transition: opacity 0.3s ease; /* Smooth fade-in */
}

/* Optional: Add an arrow/pointer */
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%; /* Position arrow at the bottom of the tooltip */
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent; /* Arrow pointing down */
}

#grid-container {
    position: fixed; /* Position relative to the viewport */
    top: 0;
    left: 0;
    width: 100vw; /* Full viewport width */
    height: 100vh; /* Full viewport height */
    z-index: -1; /* Place it behind other content */

    display: grid;
    /* Create columns of minimum 50px, filling the space */
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    /* Create rows similarly (optional, often auto works fine with columns) */
    /* grid-template-rows: repeat(auto-fill, minmax(50px, 1fr)); */

    gap: 2px; /* The space between squares, acting as grid lines */
    background-color: #e0e0e0; /* Color of the grid lines (gap background) */
}

.grid-square {
    background-color: #cccccc; /* Color of the squares */
    opacity: 0.1; /* Start mostly transparent */
    transition: opacity 1.5s ease-in-out; /* Smooth fade transition */
}

.grid-square.fade-in {
    opacity: 0.6; /* Fade to this opacity */
}

:root {
    --primary-gradient: linear-gradient(to right, #0077b6, #90e0ef);
    --hover-color: #caf0f8;
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition-speed: 0.3s;
    --embeded: #f7f7f7;
    --accent-color: #00b4d8;
}

/* Style for example foreground content */
.content {
    position: relative; /* Needed to ensure it appears above the fixed background */
    z-index: 1;
}

.resource {
    color: var(--accent-color);
}

* {
    font-family: Arial, Helvetica, sans-serif;
}

::selection ::-moz-selection {
    background: var(--hover-color);
}

#title {
    margin: 0;
    text-align: center;
    padding: 2rem 1rem;
    width: 100%;
    color: white;
    background-image: var(--primary-gradient);
    box-shadow: var(--box-shadow);
    font-size: 2.5rem;
}

.dropdown {
    position: relative;
    margin: 1rem auto;
    max-width: 768px;
    text-align: center;
}

#mlinks {
    border-bottom: 1px solid #ddd;
    overflow: hidden;
    transition: max-height var(--transition-speed) ease;
    max-height: 500px;
}

.dropdown a {
    width: 100%;
    display: block;
    padding: 0.75rem;
    background-color: var(--bg-color);
    text-decoration: none;
    transition: background-color var(--transition-speed);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.dropdown a:hover {
    background-color: var(--hover-color);
}

.mobile_links_closed {
    display: none;
    max-height: 0px;
}

#scaler {
    width: 75%;
    padding: 0.75rem;
    margin: 0.5rem 0;
    background-color: var(--bg-color);
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.btn {
    text-color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    background-color: var(--bg-color);
    border: 1px solid #ddd;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.btn:hover {
    background-color: var(--hover-color);
}

.example-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

#scaler:hover {
    background-color: var(--hover-color);
}

.content-container {
    display: flex;
    column-count: 2;
    grid-template-columns: 2fr;
    gap: 1rem;
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

.textbox {
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed);
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.sidebox {
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed);
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

@media screen and (max-width: 1150px) {
    .sidebox .textbox {
        width: 100%;
    }
}

@media screen and (min-width: 1150px) {
    .textbox {
        width: 65%;
    }
    .sidebox {
        width: 25%;
    }
}

.textbox:hover,
.sidebox:hover {
    transform: translateY(-5px);
}

.textbox h3,
.sidebox h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
}

.textbox p,
.sidebox p {
    margin-bottom: 1rem;
}

/* Quiz Styles */
.quiz-container {
    background-color: var(--embeded);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    max-width: 100%;
}

.quiz-question h4 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.option {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s;
}

.option:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

.option input[type="radio"] {
    margin-right: 12px;
}

.option label {
    cursor: pointer;
    flex: 1;
}

.quiz-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hint-btn {
    background-color: var(--accent);
}

.hints {
    margin-bottom: 1.5rem;
}

.hint {
    background-color: rgba(6, 182, 212, 0.1);
    border-left: 3px solid var(--accent);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: 0 6px 6px 0;
    display: none;
}

.hint p {
    margin: 0;
}

.feedback {
    position: relative;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
}

.correct {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
}

.incorrect {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
}

.feedback p, .feedback button {
    margin: 0;
    color: var(--text);
}

footer {
    background-color: rgb(75, 75, 75);
    color: white;
    padding: 2rem 1rem 1rem;
    margin-top: 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-section h4::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
