body {
    display: grid;
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: #f5f5f5; 
    color: #2d2d2d;
    transition: background-color 0.3s, color 0.3s;
    place-items: center;
}

.navbar {
    background-color: #ffffff;
    padding: 15px 0;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: background-color 0.3s, color 0.3s;
    border-radius: 30px;
}

.navbar ul {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.navbar li {
    margin: 0 15px;
}

.navbar a {
    color: #5e81ac;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}

.navbar a:hover {
    color: #b48ead;
    text-decoration: underline;
    transition: background-color 0.3s, color 0.3s;
}

h1 {
    font-size: 2.5em;
    margin: 20px;
    background: linear-gradient(138deg,
    #b48ead,
    #a3be8c,
    #ebcb8b,
    #d08770,
    #bf616a);
    
    background-size: 400%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow 8s ease-in-out infinite;
}

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.content {
    max-width: 814px;
    margin: 10px;
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
}

img {
    border-radius: 10px;
    margin: 0px;
}

h4 {
    text-align: center;
    font-size: 1.6em;
    font-weight: 900;
    color: #5e81ac;
    margin-top: 35px;
    margin-bottom: 18px;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 8px rgba(94,129,172,0.08);
    transition: background-color 0.3s, color 0.3s;
}

pre {
    margin: 0 auto 30px auto;
    background: #f0f0f0; 
    color: #2d2d2d;
    font-family: monospace;
    padding: 15px 24px;
    border-radius: 10px;
    max-width: 500px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: background-color 0.3s, color 0.3s;
}

h2 {
    color: #5e81ac;
}

footer {
    background-color: #f0f0f0; 
    color: #555;
    padding: 3px;
    margin-top: 30px;
    border-radius: 100px;
    transition: background-color 0.3s, color 0.3s;
}

/* Dark mode styles */
body.dark-mode {
    background-color: #2e3440;
    color: #d8dee9;
}

/* Dark mode navbar */
body.dark-mode .navbar {
    background-color: #3b4252;
}

body.dark-mode .navbar a {
    color: #d8dee9;
}

body.dark-mode .navbar a:hover {
    color: #81a1c1;
}

body.dark-mode .content {
    background: #3b4252;
}

body.dark-mode h4 {
    color: #81a1c1;
    text-shadow: 0 2px 8px rgba(129,161,193,0.12);
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode pre {
    background: #434c5e;
    color: #d8dee9;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode h2 {
    color: #81a1c1;
}

body.dark-mode footer {
    background-color: #434c5e;
    color: #eceff4;
}

/* Theme toggle button */
.theme-toggle {
    position: absolute;
    top: 33px;
    right: 33px;
    background: #eceff4;
    border: 1px solid #5e81ac;
    color: #333;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

body.dark-mode .theme-toggle {
    background: #3b4252;
    color: #d8dee9;
    border-color: #81a1c1;
}

.theme-toggle:hover {
    background: #5e81ac;
    color: #eceff4;
    border-color: #eceff4;
    transition: all 0.3s;
}

/* Responsive Navbar */
@media (max-width: 700px) {
    .navbar ul {
        flex-direction: column;
        gap: 10px;
    }
    .theme-toggle {
        position: static;
        margin: 15px auto;
        display: block;
    }
    .content {
        padding: 10px;
    }
    h1 {
        font-size: 2em;
    }
}

/* Responsive Content */
@media (max-width: 500px) {
    .content {
        max-width: 100vw;
        padding: 5px;
    }
    h1 {
        font-size: 1.5em;
    }
    pre {
        padding: 10px;
        font-size: 0.95em;
    }
    img {
        width: 100px !important;
    }
}
