body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    margin: 0;
    background-color: #e9eef2; 
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to start to see top of content if it overflows viewport */
    min-height: 100vh;
    padding: 20px; 
    box-sizing: border-box; 
    overflow-y: auto; /* Ensure body can scroll if content is taller than viewport */
}

.container {
    background-color: #ffffff;
    padding: 30px; /* Adjusted padding-left from 70px */
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 1000px;
    /* overflow: hidden; */ /* Let's comment this out to see if it helps with content visibility */
    position: relative; 
    margin-top: 20px; /* Add some margin at the top */
    margin-bottom: 20px; /* Add some margin at the bottom */
}

.notebook-spiral {
    display: none; /* Hide the spiral */
    /*
    position: absolute;
    left: 25px; 
    top: 20px; 
    bottom: 20px; 
    width: 30px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    */
}

h1 {
    text-align: center;
    color: #0D0E3E; 
    margin-bottom: 25px;
    font-size: 2.5em; 
}

.tabs {
    display: flex;
    justify-content: space-around;
    margin-bottom: 25px;
    background-color: #79d2f2; 
    border-radius: 8px; 
    overflow: hidden; 
}

.tab-button {
    padding: 15px 20px; 
    cursor: pointer;
    border: none;
    background-color: #79d2f2; 
    color: #0A0B2F; 
    font-size: 1em; 
    flex-grow: 1;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease; 
    border-right: 1px solid #66C5DC; 
}

.tab-button:last-child {
    border-right: none;
}

.tab-button.active {
    background-color: #0D0E3E; 
    color: #ffffff;
}

.tab-button:hover:not(.active) {
    background-color: #5bc0de; 
}

.tab-content-wrapper {
    position: relative;
    perspective: 1500px;
    /* min-height: 500px; */ /* Remove fixed min-height, let content define height */
    /* Add some padding at the bottom to ensure space for all content before footer */
    padding-bottom: 30px; 
}

.tab-content {
    padding: 25px;
    border: 1px solid #d1dbe5;
    border-top: none;
    border-radius: 0 0 8px 8px;
    background-color: #f8f9fa;
    
    position: absolute; 
    width: 100%; /* Changed from calc(), relies on box-sizing: border-box */
    top: 0;
    left: 0;
    box-sizing: border-box;

    max-height: 65vh; 
    overflow-y: auto; 
    
    transform-origin: left center;
    opacity: 0;
    transform: rotateY(-90deg); 
    visibility: hidden; 
    
    transition: transform 0.6s ease-in-out, opacity 0.5s ease-in-out, visibility 0s 0.6s; 
    /* Add padding at the bottom inside the scrollable area */
    padding-bottom: 50px; 
}

.tab-content.active {
    opacity: 1;
    transform: rotateY(0deg); 
    z-index: 1;
    visibility: visible;
    transition: transform 0.6s ease-in-out, opacity 0.5s ease-in-out, visibility 0s 0s;
}

.tab-content.previous {
    opacity: 0;
    transform: rotateY(90deg); 
    z-index: 0;
    visibility: hidden;
    transition: transform 0.6s ease-in-out, opacity 0.5s ease-in-out, visibility 0s 0.6s;
}


.tab-content h2 {
    color: #0D0E3E; 
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8em; 
}

.tab-content ul {
    list-style: none;
    padding: 0;
}

.tab-content li {
    display: flex;
    /* align-items: center; */ /* Changed for better flexibility with varying content heights */
    align-items: flex-start; /* Align items to the top */
    padding: 15px;
    border-bottom: 1px solid #e0e6eb; 
    margin-bottom: 12px;
    background-color: #ffffff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: transform 0.2s ease-out; 
    gap: 15px; /* Add gap for spacing between items */
}

.tab-content li:hover {
    transform: translateY(-3px); 
}

.tab-content li:last-child {
    border-bottom: none;
}

.step-number {
    width: 35px; 
    height: 35px;
    /* margin-right: 20px; */ /* Replaced by gap on parent */
    flex-shrink: 0; /* Prevent shrinking */
}

.tab-content li p {
    flex-grow: 1;
    margin: 0;
    color: #2c3e50; 
    font-size: 1em;
    line-height: 1.6; 
    word-break: break-word; /* Help prevent overflow from long words */
}

.step-image {
    width: 120px; 
    max-width: 100%; /* Ensure it doesn't overflow its container */
    height: auto;
    border-radius: 6px;
    /* margin-left: 20px; */ /* Replaced by gap on parent */
    border: 1px solid #e0e6eb; 
    flex-shrink: 0; /* Prevent shrinking */
}

footer {
    text-align: center;
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid #d1dbe5;
    color: #555; 
    font-size: 0.9em;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px; /* Adjusted padding-left from 45px */
        width: 95%;
        margin-top: 10px;
        margin-bottom: 10px;
    }

    h1 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }

    .tabs {
        flex-direction: column; /* Stack tabs vertically */
        margin-bottom: 15px;
    }

    .tab-button {
        padding: 12px 15px;
        font-size: 0.9em;
        border-right: none; /* Remove right border when stacked */
        border-bottom: 1px solid #66C5DC; /* Add bottom border */
    }

    .tab-button:last-child {
        border-bottom: none; /* Remove bottom border for the last button */
    }

    .notebook-spiral {
        /* Already hidden by the general rule, but good to be explicit if needed */
        display: none; 
        /*
        left: 10px; 
        width: 25px;
        */
    }

    .tab-content-wrapper {
        /* min-height: 300px; */ /* Remove fixed min-height */
        padding-bottom: 20px;
    }

    .tab-content {
        padding: 15px;
        max-height: 70vh; /* Adjust max-height for smaller screens */
        width: 100%; /* Changed from calc(), relies on box-sizing: border-box */
        padding-bottom: 40px; /* Inner padding for scroll content */
    }

    .tab-content h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .tab-content li {
        flex-direction: column; /* Stack li items */
        align-items: flex-start; /* Align items to the start */
        padding: 10px;
        margin-bottom: 10px;
        gap: 10px; /* Adjust gap for column layout */
    }

    .step-number {
        width: 30px;
        height: 30px;
        /* margin-right: 0; */ /* Not needed with column flex and gap */
        /* margin-bottom: 10px; */ /* Replaced by gap */
    }

    .tab-content li p {
        font-size: 0.9em;
        /* margin-bottom: 10px; */ /* Replaced by gap */
        width: 100%; /* Ensure text takes full width in column */
    }

    .step-image {
        width: 100%; /* Make image responsive */
        max-width: 200px; /* Limit max width of image */
        height: auto;
        /* margin-left: 0; */ /* Not needed with column flex and gap */
        align-self: center; /* Center image in column layout if desired, or flex-start */
    }

    footer {
        margin-top: 25px;
        padding-top: 15px;
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }

    .container {
        padding: 10px; /* Adjusted padding-left from 35px */
        width: 100%; /* Use full width on very small screens */
        box-sizing: border-box; /* Ensure padding is included in width */
    }

    .tab-content {
        /* Inherits padding: 15px and max-height: 70vh from 768px media query */
        width: 100%; /* Changed from calc(), relies on box-sizing: border-box */
        /* Inherits padding-bottom: 40px from 768px media query, adjust if needed */
        /* For consistency, explicitly state padding-bottom if different, or confirm inheritance */
        padding-bottom: 30px; /* Adjusted for very small screens if 40px was too much */
    }

    .tab-content li p {
        font-size: 0.85em; /* Slightly smaller font for very small screens */
    }

    .step-image {
        max-width: 180px; /* Further adjust image size if needed */
    }
}
