/* Adjust spacing for the section to move the title lower */
section {
    scroll-margin-top: 2rem;
    padding-top: 4rem;
    /* Add padding to push the content lower */
}

section.bg-dark {
    padding-top: 132px;
    /* Add 20px top padding */
}

section.bg-dark .d-sm-flex {
    align-items: flex-start;
    /* Align the image and text to the top */
}

section.bg-dark img {
    margin-top: 0;
    /* Remove any default margin */
    padding-top: 20px;
    /* Add spacing to ensure proper alignment */
}


/* Add rounded corners to every section */
/* Restrict section width and center it */
section {
    max-width: 960px;
    /* Restrict the width of the section */
    margin: 0 auto;
    /* Center the section horizontally */
    scroll-margin-top: 2rem;
    padding-top: 4rem;
    /* Add padding to push the content lower */
    border-radius: 10px;
    /* Rounded corners */
    overflow: hidden;
    /* Ensure content respects the rounded corners */
    border: 1px solid #ccc;
    /* Optional: Add a subtle border */
    margin-bottom: 20px;
}

/* Style for the "Sample Arduino Code" section */
#sampleArduinoCode {
    background-color: #343a40;
    /* Match the background color */
    color: #fff;
    /* Ensure text is visible */
    padding: 20px;
    /* Add padding for better spacing */
    border-radius: 10px;
    /* Rounded corners */
    overflow: hidden;
    /* Ensure content respects the rounded corners */
}

/* Styles added from my suggestion */
body {
    padding-top: 95px;
    /* <-- START WITH THIS VALUE AND ADJUST */
    /* Keep your existing body styles */
    background-color: #343a40;
    color: #fff;
    font-family: Arial, sans-serif;
    min-height: 100vh;
    /* Use min-height instead of height for flexibility */
}


.btn-primary {
    background-color: #007bff;
    /* Primary button color */
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

.container {
    max-width: 960px;
    /* Set the fixed width here */
    width: 100%;
    margin: 0 auto;
    /* Center the container */
    padding: 20px;
    box-sizing: border-box;
    /* Include padding in the width */
}

.copy-icon {
    cursor: pointer;
    margin-left: 10px;
}

.copy-feedback {
    display: none;
    font-size: 0.8em;
    color: green;
    margin-left: 10px;
}

.copy-feedback.error {
    color: red;
}

.code-wrapper {
    position: relative;
    height: auto;
}

#outputContainer .code-wrapper {
    position: relative;
    width: 100%;
    /* Ensure wrapper uses full width */
}

.code-wrapper pre {
    margin: 0;
    width: 100%;
    max-height: 60vh;
    box-sizing: border-box;
    overflow-y: auto;

}


/* Add more styles here */
/* logo image */
.logo-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
}

/* END of logo image */

/* for rounded corner-image */
.custom-rounded {
    border-radius: 10px;
    overflow: hidden;
    /* Ensures the image respects the rounded corners */

}


/* Make the textarea fill the remaining space */
#outputContainer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    max-width: 960px;
    margin: 20px auto;
    /* Center the container itself horizontally */
    width: 100%;
    box-sizing: border-box;
}

#outputContainer pre {
    max-height: 60vh;
    overflow-y: auto;
    padding-bottom: 2em;
    width: 100%;
    margin: 0 0 0 0;
    box-sizing: border-box;
    white-space: pre;
    word-wrap: normal;
    text-align: left;
}


canvas#originalCanvas,
canvas#convertedCanvas {
    display: block;
    /* Ensure the canvas behaves like a block element */
    margin: 10px auto;
    /* Center the canvas horizontally */
    max-width: 100%;
    /* Ensure the canvas is responsive */
    height: auto;
    /* Maintain aspect ratio */
}

#outputCode {
    display: block;
    line-height: 1.2em;
}

.linenums li:nth-child(even) {
    background-color: #0a0a0a;
    /* Light gray for even rows */
}

.linenums li:nth-child(odd) {
    background-color: #2c2929;
    /* Slightly darker gray */
}

#converter .card {
    background-color: var(--bs-dark);
    background-image: var(--bs-gradient);
}

/* END Styles for the Modal */
/********************************** Responsive Design ****************************/
/* Responsive Design */
@media (max-width: 960px) {
    .container {
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .image-container {
        margin-bottom: 20px;
    }

    /* Remove the width: 100% rule */
    /* #originalCanvas,
    #convertedCanvas {
        width: 100%;
        height: auto;
    } */
}

@media (max-width: 576px) {
    .container {
        padding: 10px;
    }
}

/* Style for the footer */
.footer {
    display: flex;
    /* Enable flexbox for layout */
    flex-direction: column;
    /* Stack items vertically */
    align-items: center;
    /* Center items horizontally */
    justify-content: center;
    /* Center items vertically */
    text-align: center;
    /* Ensure text inside elements is centered */
    position: relative;
    /* Keep the position-relative behavior */
}

.footer .container {
    max-width: 960px;
    /* Restrict the width of the footer content */
    margin: 0 auto;
    /* Center the container horizontally */
    text-align: center;
    /* Center the text inside the container */
}

.footer a.position-absolute {
    right: 10px;
    /* Adjust the position of the "back to top" icon */
    bottom: 10px;
    position: absolute;
}

/* Style for the navbar */
.navbar {
    border: 0;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
}