:root {
    --primary-color: #0068b4;
    --primary-color-rgb: 0, 104, 180;
    --text-color: #333;
    --bg-color: #f0f0f0;
    --header-bg: #ffffff;
    --border-color: #eeeeee;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    font-family: sans-serif;
    background: var(--bg-color);
}

.app {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.app__header {
    background: var(--header-bg);
    color: var(--text-color);
    padding: 12px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.app__logo {
    font-size: 1.2em;
    font-weight: 400;
    display: flex;
    align-items: center;
    color: var(--text-color);
}

.app__logo-img {
    height: 28px;
    width: auto;
    display: block;
}

.app__controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.app__controls-toggle {
    display: none;
    background: transparent;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    width: 36px;
    height: 36px;
    text-align: center;
}

.app__pagination {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: 1px solid #dddddd;
    border-radius: 20px;
    padding: 2px 8px;
    height: 34px;
}

.app__select {
    appearance: none;
    background-color: #f5f5f5;
    border: 1px solid #dddddd;
    color: var(--text-color);
    padding: 8px 35px 8px 15px;
    font-size: 14px;
    border-radius: 20px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px top 50%;
    background-size: 10px auto;
}

.app__select--date {
    min-width: 140px;
}

.app__select option {
    background-color: #ffffff;
    color: var(--text-color);
}

.app__select--page {
    background-color: transparent;
    border: none;
    padding-left: 5px;
    font-weight: 600;
}

.app__nav-btn {
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.app__nav-btn:hover:not(:disabled) {
    background-color: rgba(var(--primary-color-rgb), 0.1);
}

.app__nav-btn:disabled {
    color: #a0a0a0;
    cursor: not-allowed;
}

.viewer {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.viewer__container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #404040;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.viewer__nav {
    position: absolute;
    transform: translateY(-50%);
    z-index: 20;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.55);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: background 0.2s, transform 0.2s, opacity 0.2s;
}

.viewer__nav:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.75);
    transform: translateY(-50%) scale(1.03);
}

.viewer__nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.viewer__page {
    position: relative;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    background: white;
    touch-action: none;
    flex-shrink: 0;
    margin-bottom: 20px;
}

.viewer__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.viewer__hotspot {
    position: absolute;
    cursor: pointer;
}

.viewer__hotspot:hover {
    background: rgba(var(--primary-color-rgb), 0.1);
}

.viewer__ad-indicator {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
    pointer-events: none;
}

.modal__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal__content {
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    border-radius: 12px;
    position: relative;
}

.modal__close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
}

.modal__body {
    line-height: 1.7;
    color: var(--text-color);
}

.modal__body .titel { font-size: 2.2em; font-weight: 800; margin-bottom: 0.5em; }
.modal__body .dachzeile { text-transform: uppercase; color: var(--primary-color); font-weight: 700; }

.gallery {
    position: relative;
    margin-bottom: 30px;
    background: transparent;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    overflow: hidden;
}
.gallery__slider {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 280px;
    max-height: 70vh;
}
.gallery__item {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.gallery__item--active { display: flex; }
.gallery__image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.gallery__caption {
    background: rgba(255,255,255,0.92);
    padding: 10px 14px;
    font-size: 0.9em;
    margin: 0;
}
.gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: 1px solid #dddddd;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-color);
}
.gallery__nav--prev { left: 10px; }
.gallery__nav--next { right: 10px; }
.gallery__dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 0;
}
.gallery__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c9c9c9;
    cursor: pointer;
}
.gallery__dot--active { background: var(--primary-color); }

.app__loading {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.4); 
    color: rgba(255, 255, 255, 0.9); 
    padding: 8px 20px;
    border-radius: 20px;
    z-index: 9999;
    pointer-events: none;
    font-weight: 400;
    font-size: 14px;
    white-space: nowrap;
}

.app__nav-btn--logout {
    margin-left: 10px;
    color: #666;
}

@media (max-width: 1060px) {
    .app__header {
        padding: 10px 14px;
        gap: 10px;
    }

    .app__controls {
        width: 100%;
        gap: 10px;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--header-bg);
        padding: 12px 14px;
        box-shadow: 0 6px 12px rgba(0,0,0,0.08);
        border-bottom: 1px solid var(--border-color);
        overflow: hidden;
        max-height: 420px;
        opacity: 1;
        transform: translateY(0);
        transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.25s ease;
    }

    .app__controls-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .app__controls--collapsed {
        max-height: 0;
        opacity: 0;
        transform: translateY(-6px);
        pointer-events: none;
    }

    .app__select,
    .app__select--date {
        width: 100%;
        min-width: 0;
    }

    .app__pagination {
        width: 100%;
        justify-content: space-between;
        height: 34px;
    }

    .app__select--page {
        flex: 1;
        text-align: center;
        min-width: 0;
    }
}
