/* Memories2 - Dark Theme */
body {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    background-color: #111;
    color: #ddd;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1b1b1b;
    padding: 10px 20px;
    border-bottom: 1px solid #333;
}

.navbar a {
    color: #ddd;
    text-decoration: none;
    margin: 0 10px;
    font-weight: 500;
}

.navbar a:hover {
    color: #fff;
}

.logo {
    font-weight: bold;
    font-size: 1.2em;
}

.content {
    padding: 40px;
    text-align: center;
}

.home-actions {
    margin: 30px 0;
}

.btn {
    background: #333;
    color: #fff;
    padding: 10px 20px;
    margin: 0 10px;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s;
}

.btn:hover {
    background: #555;
}

.info {
    max-width: 600px;
    margin: 0 auto;
    background: #1c1c1c;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #333;
}

.footer {
    text-align: center;
    padding: 20px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    color: #777;
    font-size: 0.9em;
}
/* === Dashboard / Übersicht === */
.search-bar {
    display: flex;
    justify-content: center;
    margin: 20px auto;
    max-width: 500px;
}

.search-bar input[type=text] {
    width: 80%;
    padding: 10px;
    border: 1px solid #333;
    background: #1c1c1c;
    color: #ddd;
    border-radius: 4px 0 0 4px;
    outline: none;
}

.search-bar button {
    width: 20%;
    border: none;
    background: #333;
    color: #fff;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
}

.search-bar button:hover {
    background: #555;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
    padding: 0 30px;
}

.media-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.2s;
}

.media-card:hover {
    transform: scale(1.02);
}

.media-card .thumb img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.media-card .meta {
    padding: 10px;
}

.media-card h3 {
    margin: 5px 0;
    font-size: 1em;
}

.tag {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.8em;
    border-radius: 4px;
    background: #333;
    color: #ccc;
}
/* === Upload === */
.upload-section, .ytdlp-section {
    max-width: 500px;
    margin: 0 auto;
    text-align: left;
}

.upload-form label,
.ytdlp-section label {
    display: block;
    margin: 10px 0 5px;
    font-size: 0.9em;
    color: #aaa;
}

.upload-form input[type="text"],
.upload-form input[type="file"],
.upload-form select,
.ytdlp-section input[type="url"] {
    width: 100%;
    padding: 10px;
    background: #1c1c1c;
    border: 1px solid #333;
    color: #ddd;
    border-radius: 4px;
}

.upload-form button,
.ytdlp-section button {
    margin-top: 15px;
}
/* === Comic Viewer (Responsive Grid) === */
.comic-viewer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    padding: 10px;
}

.comic-page-wrap {
    flex: 1 1 300px;          /* Jede Seite bekommt mindestens 300px Platz */
    max-width: 400px;         /* maximale Breite pro Seite */
    display: flex;
    justify-content: center;
}

.comic-page {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    background: #111;
    box-shadow: 0 0 8px rgba(0,0,0,0.6);
    transition: transform 0.2s;
}

.comic-page:hover {
    transform: scale(1.02);
}

/* === Mobile Anpassung === */
@media (max-width: 768px) {
    .comic-viewer {
        flex-direction: column;
        align-items: center;
    }

    .comic-page-wrap {
        max-width: 95%;
    }
}
/* === Comic Lightbox Reader === */
.reader-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.reader-overlay.open {
    display: flex;
    flex-direction: column;
}

.reader-overlay img {
    max-width: 95%;
    max-height: 90vh;
    border-radius: 4px;
    object-fit: contain;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    user-select: none;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 40px;
    padding: 10px;
    cursor: pointer;
    user-select: none;
    transition: 0.2s;
}

.nav-btn:hover {
    color: #ddd;
}

.nav-btn.prev { left: 25px; }
.nav-btn.next { right: 25px; }

/* Mobile Anpassung */
@media (max-width: 768px) {
    .reader-overlay img {
        max-width: 100%;
        max-height: 80vh;
    }
    .nav-btn {
        font-size: 32px;
        padding: 5px;
    }
    .close-btn {
        font-size: 28px;
        right: 15px;
    }
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
}

.pagination span {
    color: #ccc;
}

.page-btn {
    background: #222;
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    transition: 0.2s;
}

.page-btn:hover {
    background: #444;
}

/* === Comic Viewer (Desktop) === */
.comic-viewer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    padding: 10px;
}

.comic-page-wrap {
    flex: 1 1 300px;
    max-width: 400px;
    display: flex;
    justify-content: center;
}

.comic-page {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    background: #111;
    box-shadow: 0 0 8px rgba(0,0,0,0.6);
    transition: transform 0.2s;
}

.comic-page:hover {
    transform: scale(1.02);
}

/* === Mobile: Zwei Comics nebeneinander === */
@media (max-width: 768px) {
    .comic-viewer {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        flex-direction: row; /* wichtig */
    }

    .comic-page-wrap {
        flex: 0 0 48%;   /* zwei pro Zeile */
        max-width: 48%;  /* etwas Abstand lassen */
    }
}

/* === Sehr kleine Geräte: nur 1 Comic === */
@media (max-width: 480px) {
    .comic-page-wrap {
        flex: 0 0 95%;
        max-width: 95%;
    }
}
