body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0px;
    padding: 0;
}

header {
    background-color: #598659;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

footer {
    background-color: #A3AFA3;
    color: white;
    text-align: center;
    padding: 10px 0;
    width: 100%;
    margin-top: 20px;
}

h1 {
    font-size: 1.2em;
    color: #598659;
    text-align: center;
    margin-top: 20px;
    font-size: 1.75em;
}

h2 {
    color: #3498db;
    margin: 50px;
}

h3 {
    color: #fff;
    font-size: 2em;
    text-decoration: none;
    font-weight: bold;
}

h4 {
    color: #fff;
    font-size: 1.2em;
    text-decoration: none;
    font-weight: bold;
}

h5 {
    font-family: Arial, sans-serif;
    font-weight: bold;
    color: #4a5c7a;
    font-size: 22.5px;
}

p {
    color: #333;
    font-size: 1.2em;
    line-height: 1.6;
    margin: 50px;
}

a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

a.styled-link {
    color: #fff;
    font-size: 1em;
    text-decoration: none;
    font-weight: bold;
}

a.styled-link:hover {
    text-decoration: none;
}

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

nav ul li {
    margin-right: 20px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

nav ul li a:hover {
    text-decoration: none;
}

/* index ------------------------------------------------------------------------ */

main {
    padding: 20px;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 40vh;
    overflow: hidden;
    margin: 0 auto;
}

.carousel {
    display: flex;
    transition: transform 1s ease;
    width: 100%;
}

.carousel-item {
    flex: 0 0 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-size: cover;
    background-position: center;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-container:hover .carousel {
    animation-play-state: paused;
}

.carousel-nav.left {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    font-size: 30px;
    color: rgb(0, 0, 0);
    cursor: pointer;
    z-index: 10;
}

.carousel-nav.right {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 30px;
    color: rgb(0, 0, 0);
    cursor: pointer;
    z-index: 10;
}

.dashboard {
    padding: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1200px;
    width: 100%;
}

.card {
    background-color: #f2f2f2;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.card h3 {
    margin-top: 0;
}

.card p {
    margin-bottom: 10px;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.book {
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.book-image {
    max-width: 50%;
    height: auto;
    margin-top: 20px;
    margin-bottom: 20px;
}

.details-button {
    background: none;
    border: none;
    color: #007bff;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
}

.details-button:hover {
    text-decoration: none;
    color: darkblue;
}

.overlay-toggle {
    display: none;
}

.overlay-toggle:checked + .overlay {
    opacity: 1;
    visibility: visible;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.overlay-background {
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.overlay-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    align-items: flex-start;
    width: 80%;
    margin-top: 130px;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    max-height: auto;
}

.overlay-content iframe {
    width: 100%;
    height: 550px;
    border: none;
    display: block;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 30px;
    cursor: pointer;
}

/* news ------------------------------------------------------------------------ */

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

.news-item {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease-in-out;
    width: 100%;
    box-sizing: border-box;
}

.news-item:hover {
    transform: scale(1.02);
    z-index: 1;
}

.news-item h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.news-date {
    font-size: 12px;
    color: #666;
}

.news-description {
    font-size: 14px;
    color: #444;
    margin-bottom: 10px;
    text-align: justify;
}

.news-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
}

.news-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: flex-start;
    overflow: auto;
    padding-top: 150px;
    z-index: 9999;
}

.news-popup {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-height: 70vh;
    max-width: 600px;
    text-align: center;
    position: relative;
    overflow-y: auto;
}

.news-popup img {
    width: 100%;
    border-radius: 5px;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

.news-button {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
}

.news-button:hover {
    background: #0056b3;
}

/* suche ------------------------------------------------------------------------ */

.main-search {
    min-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: #f5f8fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#searchInput {
    width: 320px;
    max-width: 90vw;
    padding: 14px 20px;
    font-size: 1.1rem;
    border: 2px solid #007bff;
    border-radius: 30px;
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.2);
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#searchInput:focus {
    border-color: #0056b3;
    box-shadow: 0 0 10px #0056b3;
}

#results {
    width: 320px;
    max-width: 90vw;
    margin-top: 25px;
}

.result-item {
    background: #fff;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease;
}

.result-item:hover {
    background-color: #e9f0ff;
}

.result-item h5 {
    margin: 0 0 6px 0;
    color: #003366;
    font-weight: 600;
}

.result-item div {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 4px;
}

.result-item div:last-child {
    color: #333;
}

/* Mobile Version ------------------------------------------------------------------------ */

@media (max-width: 800px) {
    header {
        flex-direction: column;
        position: relative;
        text-align: center;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        padding: 0;
    }

    nav ul li {
        margin: 5px 0;
    }

    .carousel-container {
        display: none !important;
    }

    .book-grid {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        gap: 20px;
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}