/* YCC Bla-i-PDF — Flipbook styling */

.ycc-bla-wrapper {
    margin: 20px auto;
    font-family: 'Segoe UI', Arial, sans-serif;
    max-width: 100%;
    box-sizing: border-box;
}

.ycc-bla-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 10px;
    background: #222;
    border-radius: 8px 8px 0 0;
}

.ycc-bla-btn {
    background: #555;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.ycc-bla-btn:hover { background: #777; }

.ycc-bla-fs {
    margin-left: auto;
    font-size: 18px;
}

.ycc-bla-pages {
    color: #ccc;
    font-size: 14px;
    min-width: 120px;
    text-align: center;
}

.ycc-bla-container {
    background: #444;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    position: relative;
}

/* Navigasjonsknapper inne i boken */
.ycc-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    background: rgba(0,0,0,0.35);
    color: #fff;
    border: none;
    font-size: 28px;
    padding: 20px 10px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s, opacity 0.2s;
    opacity: 0.5;
}
.ycc-nav-btn:hover {
    background: rgba(0,0,0,0.7);
    opacity: 1;
}
.ycc-nav-prev { left: 12px; }
.ycc-nav-next { right: 12px; }

/* Utvidet visning (overlay) */
.ycc-bla-wrapper.ycc-expanded {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    z-index: 999999;
    margin: 0;
    background: rgba(0,0,0,0.92);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 0;
}
.ycc-bla-wrapper.ycc-expanded .ycc-bla-toolbar {
    border-radius: 0;
}
.ycc-bla-wrapper.ycc-expanded .ycc-bla-container {
    border-radius: 0;
    background: transparent;
}
.ycc-close-btn {
    position: fixed;
    top: 15px;
    right: 20px;
    z-index: 1000000;
    background: #d63638;
    color: #fff;
    border: none;
    padding: 10px 22px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.ycc-close-btn:hover {
    background: #b32d2f;
}

/* Zoom-kontroller i utvidet visning */
.ycc-zoom-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000000;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.75);
    padding: 8px 16px;
    border-radius: 30px;
    backdrop-filter: blur(6px);
}
.ycc-zoom-controls button {
    background: #555;
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.ycc-zoom-controls button:hover { background: #888; }
.ycc-zoom-controls span {
    color: #ddd;
    font-size: 14px;
    min-width: 50px;
    text-align: center;
}

.ycc-flipbook {
    margin: 0 auto;
}

.ycc-bla-page {
    background: #fff;
    overflow: hidden;
}

.ycc-bla-page canvas {
    display: block;
    margin: 0 auto;
}

/* Turn.js shadow/gradient overrides */
.ycc-flipbook .turn-page-wrapper {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Responsiv: skaler ned på små skjermer */
@media (max-width: 960px) {
    .ycc-bla-wrapper {
        max-width: 100% !important;
    }
    .ycc-bla-container {
        padding: 10px;
    }
}

@media (max-width: 600px) {
    .ycc-bla-toolbar {
        flex-wrap: wrap;
        gap: 5px;
    }
}

/* ===== Arkiv-liste (ycc_bla_arkiv) ===== */
.ycc-bla-arkiv-item {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 80px;
    max-height: 80px;
    box-sizing: border-box;
}
.ycc-bla-arkiv-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-color: #d63638;
}
.ycc-bla-arkiv-row {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
}
.ycc-bla-arkiv-thumb {
    width: 30px;
    flex-shrink: 0;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.ycc-bla-arkiv-title {
    margin: 0;
    color: #111;
    font-size: 16px;
    font-weight: 800;
    border: none !important;
    padding: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ycc-bla-arkiv-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.ycc-bla-arkiv-btn {
    background: #d63638;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
    flex-shrink: 0;
    cursor: pointer;
}
.ycc-bla-arkiv-btn:hover {
    background: #b32d2f;
}
/* Tittel-link: usynlig på desktop, klikkbar på mobil */
.ycc-bla-arkiv-title-link {
    color: inherit;
    text-decoration: none;
    pointer-events: none;
}

/* ===== Seksjonstittel ===== */
.ycc-bla-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #444;
    margin: 28px 0 12px;
    padding: 0;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Mappe-grid ===== */
.ycc-bla-folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.ycc-bla-folder-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 10px 14px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    position: relative;
}
.ycc-bla-folder-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
    border-color: #d63638;
}
.ycc-bla-folder-tile-icon {
    font-size: 40px;
    line-height: 1;
}
.ycc-bla-folder-tile-name {
    font-size: 14px;
    font-weight: 700;
    color: #222;
    text-align: center;
    word-break: break-word;
}
.ycc-bla-folder-tile-count {
    font-size: 11px;
    color: #999;
}

/* ===== Mappe-innhold overlay ===== */
.ycc-bla-folder-overlay {
    margin-top: 12px;
    background: #f7f7f7;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    padding: 15px 20px 20px;
}
.ycc-bla-folder-overlay-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.ycc-bla-folder-back {
    background: #555;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.ycc-bla-folder-back:hover { background: #333; }
.ycc-bla-folder-overlay-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #222;
    border: none !important;
    padding: 0 !important;
}
.ycc-bla-folder-overlay-list .ycc-bla-arkiv-item {
    margin-bottom: 8px;
}

@media (max-width: 600px) {
    .ycc-bla-folder-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 10px;
    }
    .ycc-bla-folder-tile { padding: 12px 8px 10px; }
    .ycc-bla-folder-tile-icon { font-size: 32px; }
    .ycc-bla-folder-tile-name { font-size: 12px; }
    .ycc-bla-folder-overlay { padding: 10px 12px 14px; }
}

/* Arkiv-overlay (fullskjerm for flipbook) */
.ycc-bla-arkiv-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background: rgba(0,0,0,0.92);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.ycc-bla-arkiv-overlay .ycc-bla-toolbar {
    border-radius: 0;
}
.ycc-bla-arkiv-overlay .ycc-bla-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
}
.ycc-bla-arkiv-overlay .ycc-close-btn {
    position: fixed;
    top: 15px;
    right: 20px;
}

/* Arkiv-liste mobil */
@media (max-width: 600px) {
    .ycc-bla-arkiv-item {
        flex-direction: column !important;
        align-items: stretch !important;
        min-height: auto !important;
        max-height: none !important;
        padding: 15px !important;
        gap: 10px !important;
    }
    .ycc-bla-arkiv-row { gap: 10px !important; }
    .ycc-bla-arkiv-title { font-size: 13px !important; }
    .ycc-bla-arkiv-actions {
        flex-direction: column !important;
        gap: 5px !important;
    }
    .ycc-bla-arkiv-btn {
        display: none !important;
    }
    .ycc-bla-arkiv-title-link {
        pointer-events: auto;
        color: #d63638;
        text-decoration: underline;
    }
}
