body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #28a745; /* Green */
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #e0e0e0;
}

/* New: Container for main content and sidebars */
.container {
    display: flex;
    flex-grow: 1;
    width: 100%;
    max-width: 1200px; /* Adjust as needed */
    margin: 20px auto;
    padding: 0 20px; /* Add some padding on the sides */
    box-sizing: border-box; /* Include padding in element's total width/height */
}

main {
    flex-grow: 1;
    padding: 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin: 0 20px; /* Space between main content and sidebars */
    min-width: 0; /* Allow main to shrink on smaller screens */
}

/* New: Sidebar Styling */
.left-sidebar, .right-sidebar {
    flex-shrink: 0; /* Prevent sidebars from shrinking */
    width: 180px; /* Fixed width for sidebars */
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.ad-space {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9em;
    color: #666;
    width: 100%; /* Fill sidebar width */
    box-sizing: border-box;
}

.ad-space p {
    margin-top: 0;
    font-weight: bold;
}

.ad-space img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
}


.upload-section, .output-section, .blog-post, .dummy-text-section { /* Added .dummy-text-section */
    width: 100%;
    text-align: center; /* Center alignment for these sections */
    margin-bottom: 2rem;
}

h1, h2 {
    color: #28a745;
    margin-bottom: 1rem;
}

input[type="file"] {
    margin-bottom: 1rem;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: fit-content;
    display: block;
    margin: 0 auto 1rem;
}

button {
    background-color: #007bff; /* Blue */
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

button:hover:not(:disabled) {
    background-color: #0056b3;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#imageCanvas {
    max-width: 100%;
    height: auto;
    border: 1px dashed #ccc;
    margin-top: 1.5rem;
    display: block; /* To center */
    margin-left: auto;
    margin-right: auto;
}

#downloadBtn {
    margin-top: 1.5rem;
    background-color: #28a745; /* Green */
}

#downloadBtn:hover {
    background-color: #218838;
}

.hidden {
    display: none !important;
}

#loading {
    margin-top: 1rem;
    font-style: italic;
    color: #666;
}

/* Blog post and dummy text styling */
.blog-post, .dummy-text-section {
    text-align: left; /* Align text left within these sections */
    padding: 1rem 0;
}

.blog-post h2, .blog-post h3, .dummy-text-section h3 {
    text-align: center; /* Center headings for these sections */
}

.blog-post ul, .blog-post ol {
    margin-left: 20px;
    text-align: left;
}


footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: auto; /* Pushes footer to the bottom */
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .container {
        flex-direction: column; /* Stack sidebars and main content vertically */
        padding: 0;
    }

    .left-sidebar, .right-sidebar {
        width: 100%;
        order: -1; /* Move sidebars above main content on small screens */
        padding: 1rem;
        background-color: #f8f8f8;
        box-shadow: 0 0 5px rgba(0,0,0,0.05);
        margin-bottom: 20px;
    }

    .right-sidebar {
        order: 1; /* Keep right sidebar at bottom on small screens */
    }

    main {
        margin: 0 10px; /* Adjust margin for main content */
        padding: 1.5rem;
    }
}

@media (max-width: 600px) {
    header {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        margin-top: 10px;
    }

    nav ul li {
        margin: 0 10px;
    }

    main {
        padding: 1rem;
    }
}