/* Original Styles */
body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    flex-direction: column;
}

.container {
    display: flex;
    flex-direction: row;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
    width: 80%;
}

h1 {
    grid-column: span 2;
    text-align: center;
    margin-bottom: 20px;
}

.iteration-control {
    grid-column: span 2;
    text-align: center;
}

.iteration-control button {
    margin: 5px;
}

.input-control {
    grid-column: span 2;
    text-align: center;
    margin-bottom: 20px;
}

.input-control label {
    margin-right: 10px;
}

.input-control input {
    padding: 5px;
    font-size: 16px;
    width: 60px;
    text-align: center;
}

.code-window, .visual-window, .memory-window {
    flex: 1;
    margin: 10px;
    background-color: white;
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.code-window h3, .visual-window h3, .memory-window h3 {
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
}

.code-window pre {
    text-align: left;
    margin: 0;
}

.code-window span {
    display: inline;
    padding: 0 0;
}

.highlight-arrow {
    stroke: red !important;
}

.highlight-text {
    fill: red !important;
    color: red !important;
}

.highlight {
    background-color: yellow;
    outline: 2px solid #ff6a00;
    outline-offset: 1.5px;
}

pre, code {
    font-size: 18px; /* Increase font size as needed */
    line-height: 2; /* Optional: Improve readability with increased line height */
    font-family: 'Courier New', Courier, monospace; /* Ensure it's a monospaced font */
}

pre {
    text-align: left; /* Aligns text to the left */
    margin: 0; /* Removes default margin */
    padding: 10px 0; /* Removes default padding */
}

.visual-window {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.memory-window {
    grid-column: span 2;
    text-align: center;
}

.memory-block {
    display: flex;
    align-items: center;
    margin: 10px;
}

.variable-name {
    background-color: lightblue;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #000000; /* Yellow border */
}

.variable-name-hl {
    background-color: yellow;
    outline: 3px solid #ff6a00;
    padding: 10px;
    border-radius: 5px;
}

.pointer {
    width: 30px;
    height: 2px;
    background-color: black;
    margin: 0 10px;
    position: relative;
}

.pointer::after {
    content: '';
    position: absolute;
    top: -5px;
    right: -10px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent transparent black;
}

.memory-value {
    background-color: #e8e8e8;
    border: 1px solid rgb(0, 0, 0);
    border-radius: 5px;
    padding: 10px;
    min-width: 40px;
    text-align: center;
}

button {
    margin-left: 5px;
    padding: 2px 5px;
    font-size: 12px;
    cursor: pointer;
}

.hidden {
    display: none;
}

#interactive-element {
    background-color: white;
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.light-blue {
    background-color: lightblue !important;
}

.visual-window {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#visual {
    display: grid;
    grid-template-columns: repeat(12, 50px);
    grid-gap: 5px;
}

.visual-box {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #ccc;
    background-color: #ffe;
    border-radius: 5px;
    position: relative;
}

.visual-box.light-blue {
    background-color: lightblue;
}

.nested-list {
    display: flex;
    flex-direction: column;
}

.inner-list {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.list-index {
    background-color: lightblue;
    padding: 5px;
    border-radius: 5px;
    margin-right: 5px;
}

.index-value {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: small;
    color: gray;
}

.visual-box {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #ccc;
    background-color: #ffe;
    border-radius: 5px;
    position: relative;
    margin: 5px;
}

.visual-title {
    text-align: center; /* Center the title horizontally */
    margin: 0; /* Remove any default margin */
    position: absolute;
    top: 20px; /* Pin the title to the top */
    width: 100%;
    font-size: 20px;
    font-weight: bold;
}

.highlight-box {
    background-color: lightblue;
}

.index-value {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: small;
    color: gray;
}

.visual-window {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.arrow {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 20px solid black; /* Changed from border-top to border-bottom */
    position: absolute;
    bottom: -25px; /* Position the arrow outside the box */
}

.nested-list {
    display: flex;
    align-items: center;
}

.variable-name {
    background-color: #e8e8e8;
    padding: 5px 10px;
    border-radius: 5px;
    margin-right: 10px;
    position: relative;
}

.arrow-right {
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 10px solid black;
    margin-right: 10px;
    position: relative;
}

.list-container {
    display: flex;
    align-items: center;
    background-color: rgb(255, 255, 255);
    border: 3px solid #cc0;
    padding: 5px 10px;
    border-radius: 5px;
    position: relative;
}

.index-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 5px;
    position: relative;
}

.list-index {
    background-color: #c9c9c9;
    border: 1px solid #000000;
    padding: 5px 10px;
    border-radius: 5px;
    margin-bottom: 5px;
    margin-top: 5px;
}

.arrow-down {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 10px solid black;
    margin: 5px 0;
}

.list-value {
    background-color: #e8e8e8;
    padding: 5px 10px;
    border: 1px solid rgb(0, 0, 0);
    border-radius: 5px;
    position: relative;
    margin-top: 5px;
}

.lined-paper {
    width: 230px;
    height: 350px;
    top: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

.paper-with-image {
    display: flex;
    height: 450px;
    flex-direction: column;
    align-items: center;
    background-image: url('clipboard.png'); /* Background image for the conveyor belt */
    background-size: cover;
}

.list-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 5px;
    border-bottom: 1px solid #ccc; /* Optional for better visibility */
}

.index {
    font-weight: bold;
    margin-right: 10px;
}

.value {
    background-color: #e6f7ff;
}

.box {
    background-color: None;
    width: 60px;
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    padding-bottom: 20px;
}

.box-image {
    width: 110px;
    height: 140px;
    /* margin-bottom: 10px; */
}

.index {
    font-size: 14px;
    color: #333;
}

.highlight-item {
    background-color: #ffff99; /* Light yellow highlight */
    border: 3px solid #ff6a00;
}

.highlight-item-index {
    background-color: yellow; /* Light yellow highlight */
    border: 3px solid #ff6a00; /* Yellow border */
}

.variable {
    font-family: 'Courier New', Courier, monospace; /* Example font */
    color:#ff6a00
}

.step-explanation {
    background-color: #e4edef;
    color: #000000;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
}

button {
    background-color: #ffffff; /* Green background */
    border: none; /* Remove borders */
    color: rgb(0, 0, 0); /* White text */
    padding: 10px 20px; /* Add some padding */
    text-align: center; /* Center the text */
    text-decoration: none; /* Remove underline */
    display: inline-block; /* Get the buttons to align properly */
    font-size: 16px; /* Increase font size */
    font-weight: bold;
    margin: 4px 2px; /* Add some margin */
    cursor: pointer; /* Pointer/hand icon */
    border-radius: 12px; /* Rounded corners */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: 0.3s; /* Smooth transitions */
    outline: 2px solid rgba(0, 0, 0, 0.2); /* Add outline */
}

button:hover {
    background-color: #bdd5d7; /* Darker green on hover */
}

button:active {
    background-color: #e4edef; /* Even darker when clicked */
    box-shadow: 0 2px #666; /* Reduce shadow when clicked */
    transform: translateY(2px); /* Move button down on click */
}

.image-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.laptop-space {
    flex: 1;
    position: relative;
}

.laptop-image {
    max-width: 100%; /* Adjust size of the laptop image */
    height: auto;
}

/* Boxes overlayed on the laptop */
.laptop-overlay {
    position: absolute;
    width: 140px; /* Size of the box */
    height: 95px;
    
}

.top-left-box {
    top: 59px;
    left: 29px;
    background-image: url('bubbleB.png'); /* Background image for the conveyor belt */
    background-size: cover;
    font-size: 14px;         /* Adjust font size as needed */
    text-align: center;
    font-weight: bold;
}

.bottom-right-box {
    bottom: 110px;
    right: 25px;
    background-image: url('bubble.png'); /* Background image for the conveyor belt */
    background-size: cover;
    font-size: 14px;         /* Adjust font size as needed */
    text-align: center;
    font-weight: bold;
}

.paper-with-image {
    flex: 1;
    display: flex;
    justify-content: center;
    background-image: url('clipboard.png'); 
    background-size: cover;
}

.line {
    height: 20%;
    border-bottom: 2px solid #ccc; /* Grey line */
    margin-bottom: 10px;
    font-size: 20px; /* Bigger text inside the lines */
    color: #333;
    display: flex;
    align-items: center; /* Center text vertically */
    padding-left: 10px; /* Add padding for text inside the lines */
}

/* Ensuring the last line also has spacing */
.line:last-child {
    margin-bottom: 10px;
}

.paper-title {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px; /* Space between title and first line */
    color: #333;
}

.laptop-title {
    position: absolute;
    top: 30px; /* Adjust to move title vertically */
    left: 10%;
    padding: 5px 10px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    z-index: 1; /* Ensure it stays above the image */
}

/* -------------------------------------- */
/* Added Animations Below */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes slideInLeft {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Apply fade-in animation to step explanation */
.step-explanation {
    animation: fadeIn 0.5s ease-in-out;
    transition: opacity 0.5s ease-in-out;
}

/* Animate code lines when they are highlighted */
.highlight {
    animation: pulse 1s infinite;
    transition: background-color 0.5s, outline 0.5s;
}

/* Add fade-in effect to memory blocks */
.memory-block {
    animation: fadeIn 0.5s ease-in-out;
}

/* Add slide-in animations to overlays on the laptop */
.top-left-box, .bottom-right-box {
    animation: slideInLeft 0.5s ease-out;
}

/* Add pulse animation to student values */
.student-value {
    animation: pulse 2s infinite;
}

/* Optional: Add hover animations to memory values for interactivity */
.memory-value:hover {
    animation: pulse 1s infinite;
}

/* Ensure smooth transitions for background and border changes */
.variable-name, .memory-value, .list-value, .student-value {
    transition: background-color 0.3s, border 0.3s;
}

/* -------------------------------------- */
