/* Reset and prevent horizontal scrolling */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevents horizontal scrolling */
    width: 100%;
}

/* Ensure content does not overflow */
* {
    max-width: 100%;
    box-sizing: border-box;
}

/* Body styles */
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

/* Headings with different font styles */
h1, h2 {
    font-family: 'Times New Roman', Times, serif;
    word-wrap: break-word; /* Ensure text never overflows */
}

/* Header */
header {
    background-color: #333;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

/* Left section of header */
.header-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

/* Title */
header h1 {
    margin: 0;
    font-size: 28px;
    flex-wrap: wrap;
    word-break: break-word;
}

/* Navigation */
nav {
    display: flex;
    align-items: center;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    padding: 5px 0;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    background-color: #555;
    color: #fff;
    border: none;
    padding: 8px 15px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    margin-right: 20px;
    transition: background-color 0.3s, color 0.3s;
}

.dark-mode-toggle:hover {
    background-color: #777;
}

/* Main content */
.content {
    flex: 1;
    padding: 40px;
    text-align: left;
    max-width: 90%;
    margin: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure content does not overflow on smaller screens */
@media screen and (max-width: 1024px) {
    .content {
        max-width: 95%;
        padding: 30px;
    }
}

@media screen and (max-width: 768px) {
    .content {
        padding: 20px;
        max-width: 100%;
    }
}

/* Ensure images resize properly */
.content img {
    width: 100%;
    max-width: 100%;
    display: block;
    margin: 20px auto;
    border-radius: 10px;
    height: auto;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background-color: #333;
    color: #fff;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    bottom: 0;
}

/* Social media links */
footer a {
    color: #fff;
    margin: 0 10px;
    text-decoration: none;
    font-size: 20px;
}

footer a:hover {
    color: #ccc;
}

/* Light/Dark Mode */
body.dark-mode {
    background-color: #333;
    color: #fff;
}

.dark-mode header, .dark-mode footer {
    background-color: #000;
}

/* Corrected Dark Mode Link Styles */
.dark-mode a,
.dark-mode a:link,
.dark-mode a:visited,
.dark-mode a:active {
    color: #fff !important;
}

.dark-mode a:hover {
    color: #ccc !important;
}

.dark-mode .dark-mode-toggle {
    background-color: #fff;
    color: #333;
}

.dark-mode .dark-mode-toggle:hover {
    background-color: #ddd;
}

/* Responsive Design for Smaller Screens */
@media screen and (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .header-left {
        flex-direction: column;
        margin-bottom: 10px;
    }

    header h1 {
        font-size: 22px;
        padding-left: 0;
        margin-bottom: 10px;
        text-align: center;
    }

    nav ul {
        flex-direction: column;
    }

    nav ul li {
        margin: 5px 0;
    }

    .dark-mode-toggle {
        margin-bottom: 10px;
        margin-right: 0;
    }

    .content img {
        max-width: 100%;
    }
}