* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-theme {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.header-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

#theme-toggle {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

#theme-toggle:hover {
    background-color: #0056b3;
}

body.dark-theme #theme-toggle {
    background-color: #4a90e2;
}

.navbar {
    background-color: #007BFF;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s;
}

body.dark-theme .navbar {
    background-color: #003087;
}

.navbar ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.navbar li {
    margin: 0 10px;
}

.navbar a {
    color: white;
    text-decoration: none;
    padding: 10px;
    font-size: 16px;
    transition: background-color 0.3s;
}

.navbar a:hover {
    background-color: #0056b3;
    border-radius: 5px;
}

body.dark-theme .navbar a:hover {
    background-color: #4a90e2;
}

.image-container {
    margin: 20px 0;
    text-align: center;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.text-section {
    background-color: white;
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, box-shadow 0.3s;
    scroll-margin-top: 80px; /* Offset for sticky navbar */
}

body.dark-theme .text-section {
    background-color: #2c2c2c;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.text-section h2 {
    color: #007BFF;
    margin-bottom: 15px;
    transition: color 0.3s;
}

body.dark-theme .text-section h2 {
    color: #4a90e2;
}

.text-section p {
    margin-bottom: 15px;
}

.text-section h3 {
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
    transition: color 0.3s;
}

body.dark-theme .text-section h3 {
    color: #e0e0e0;
}

.text-section ol {
    padding-left: 20px;
}

.text-section li {
    margin-bottom: 10px;
}

.font-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.font-decrease, .font-increase {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

body.dark-theme .font-decrease,
body.dark-theme .font-increase {
    background-color: #4a90e2;
}

.font-decrease:hover, .font-increase:hover {
    background-color: #0056b3;
}

body.dark-theme .font-decrease:hover,
body.dark-theme .font-increase:hover {
    background-color: #357abd;
}

#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    display: none;
    transition: background-color 0.3s;
}

body.dark-theme #back-to-top {
    background-color: #4a90e2;
}

#back-to-top:hover {
    background-color: #0056b3;
}

body.dark-theme #back-to-top:hover {
    background-color: #357abd;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .navbar ul {
        flex-direction: column;
        align-items: center;
    }

    .navbar li {
        margin: 5px 0;
    }

    .navbar a {
        font-size: 14px;
        padding: 8px;
    }

    .text-section {
        padding: 15px;
        scroll-margin-top: 100px; /* Adjust for taller navbar on mobile */
    }

    #theme-toggle {
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .navbar a {
        font-size: 12px;
    }

    .text-section h2 {
        font-size: 1.5em;
    }

    .text-section h3 {
        font-size: 1.2em;
    }

    .text-section p, .text-section li {
        font-size: 14px;
    }

    #back-to-top {
        padding: 8px 15px;
        font-size: 14px;
    }

    #theme-toggle {
        font-size: 10px;
        padding: 5px 10px;
    }

    .font-decrease, .font-increase {
        font-size: 14px;
        padding: 4px 8px;
    }
}

/* Добавете този код към съществуващия файл след съществуващите стилове */

.header-controls {
    display: flex;
    justify-content: space-between; /* Променено от flex-end на space-between */
    align-items: center; /* Добавено за вертикално центриране */
    margin-bottom: 10px;
    position: relative; /* Добавено за позициониране */
}

/* Добавете това за заглавието */
.header-controls::before {
    content: "Четене с интерес и разбиране";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem; /* По-голям размер */
    color: #007BFF; /* Синьо */
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}

/* За да се вижда бутонът в тъмна тема */
body.dark-theme .header-controls::before {
    color: #4a90e2; /* Светло синьо за тъмна тема */
}

/* Медии за по-малки екрани */
@media (max-width: 768px) {
    .header-controls::before {
        font-size: 1.5rem;
        white-space: normal;
        width: 100%;
        text-align: center;
        padding: 0 10px;
        position: static;
        transform: none;
        margin-bottom: 10px;
    }
    
    .header-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    #theme-toggle {
        align-self: flex-end;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .header-controls::before {
        font-size: 1.2rem;
    }
}