/* WBLBR FlipBook - Public Styles - Apple-inspired Glassmorphism */
:root {
    --primary: #007aff;
    --gray-100: #f5f5f7;
    --gray-200: #e8e8ed;
    --gray-400: #aeaeb2;
    --gray-500: #8e8e93;
    --gray-700: #48484a;
    --gray-800: #2c2c2e;
    --radius: 16px;
    --glass: rgba(255,255,255,.65);
    --glass-border: rgba(255,255,255,.6);
    --gradient-bg: linear-gradient(145deg, #dbeafe 0%, #ede9fe 25%, #fce7f3 50%, #e0f2fe 75%, #d1fae5 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--gradient-bg); background-attachment: fixed;
    color: var(--gray-800); line-height: 1.6; min-height: 100vh;
}
.container { max-width: 1000px; margin: 0 auto; padding: 0 1.5rem; }

.site-header {
    padding: 1.5rem 0; margin-bottom: 1.5rem;
    background: rgba(255,255,255,.45);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,.5);
    position: sticky; top: 0; z-index: 10;
}
.site-header-row { display: flex; justify-content: space-between; align-items: center; }
.site-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; }
.site-logo { max-height: 40px; display: block; }

/* View toggle */
.view-toggle { display: flex; gap: 2px; background: rgba(0,0,0,.06); border-radius: 8px; padding: 2px; }
.view-toggle-btn {
    background: none; border: none; cursor: pointer; padding: .35rem .5rem;
    border-radius: 6px; color: var(--gray-500); display: flex; align-items: center;
    transition: all .2s;
}
.view-toggle-btn:hover { color: var(--gray-700); }
.view-toggle-btn.active { background: rgba(255,255,255,.8); color: var(--gray-800); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.catalog-grid {
    display: flex; flex-wrap: wrap; gap: 1.25rem; padding-bottom: 3rem;
    justify-content: flex-start;
}
.catalog-card { width: 180px; }
.catalog-card {
    display: flex; flex-direction: column;
    background: var(--glass); border: 1px solid var(--glass-border);
    border-radius: var(--radius); overflow: hidden;
    text-decoration: none; color: var(--gray-800);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
    transition: all .25s ease;
}
.catalog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,.1);
    border-color: rgba(0,122,255,.25);
}

.catalog-card-thumb {
    height: 180px; overflow: hidden; background: var(--gray-100);
    display: flex; align-items: center; justify-content: center;
}
.catalog-card-thumb img {
    width: 100%; height: 100%; object-fit: contain;
    transition: transform .4s ease;
}
.catalog-card:hover .catalog-card-thumb img { transform: scale(1.05); }
.catalog-card-placeholder { color: var(--gray-400); }

.catalog-card-body { padding: .7rem .85rem .65rem; display: flex; flex-direction: column; flex: 1; }
.catalog-card-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: auto; padding-top: .35rem; border-top: 1px solid rgba(0,0,0,.04);
}
.catalog-card-dl {
    display: flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; min-width: 26px; border-radius: 50%;
    color: var(--gray-400); cursor: pointer; transition: all .2s;
}
.catalog-card-dl:hover { color: var(--primary); background: rgba(0,122,255,.08); }
.catalog-card-body h2 { font-size: .88rem; font-weight: 600; margin-bottom: .15rem; line-height: 1.3; letter-spacing: -.01em; }
.catalog-card-body p { font-size: .78rem; color: var(--gray-500); margin-bottom: .25rem; line-height: 1.35; }
.catalog-pages { font-size: .72rem; color: var(--gray-400); font-weight: 500; }

.error-page { text-align: center; padding: 5rem 1rem; }
.error-page h1 { font-size: 5rem; font-weight: 800; color: rgba(0,0,0,.06); letter-spacing: -.05em; }
.error-page p { color: var(--gray-500); margin: .75rem 0 1.5rem; }
.btn {
    display: inline-flex; align-items: center; padding: .5rem 1.1rem;
    background: var(--glass); border: 1px solid var(--glass-border);
    border-radius: 10px; text-decoration: none; color: var(--gray-700);
    font-size: .85rem; font-weight: 500;
    backdrop-filter: blur(8px); transition: all .2s;
}
.btn:hover { background: rgba(255,255,255,.85); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.btn-primary { background: var(--primary); color: #fff; border-color: transparent; }

/* Desk View */
.desk-view {
    position: relative; overflow: hidden; border-radius: 0;
    min-height: 500px; user-select: none;
    margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%);
    width: 100vw;
}
.desk-doc {
    position: absolute; cursor: grab;
    transition: box-shadow .3s, transform .3s;
    border-radius: 4px; overflow: visible;
}
.desk-doc-active { cursor: grabbing; transition: none !important; }
.desk-doc img {
    height: 200px; width: auto; display: block; border-radius: 3px;
    box-shadow: 0 4px 16px rgba(0,0,0,.18), 0 1px 3px rgba(0,0,0,.1);
    background: #fff; pointer-events: none;
}
.desk-doc:hover img {
    box-shadow: 0 8px 28px rgba(0,0,0,.22), 0 2px 6px rgba(0,0,0,.1);
}
.desk-doc-placeholder {
    width: 140px; height: 200px; background: #fff; border-radius: 3px;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
    font-size: .75rem; color: var(--gray-500); text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.desk-doc-label {
    text-align: center; font-size: .68rem; font-weight: 600; color: var(--gray-700);
    margin-top: .35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 180px; text-shadow: 0 1px 3px rgba(255,255,255,.8);
    pointer-events: none;
}
/* Hover actions */
.desk-doc-hover {
    position: absolute; top: 0; left: 0; right: 0; bottom: 24px;
    display: flex; align-items: center; justify-content: center; gap: .75rem;
    opacity: 0; transition: opacity .2s;
    background: rgba(0,0,0,.35); border-radius: 3px;
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.desk-doc:hover .desk-doc-hover { opacity: 1; }
.desk-action {
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,.9); color: var(--gray-800);
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; transition: all .2s;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.desk-action:hover { background: #fff; transform: scale(1.1); box-shadow: 0 4px 14px rgba(0,0,0,.2); }

/* Rotate handle */
.desk-rot-handle {
    position: absolute; top: -12px; right: -12px;
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(255,255,255,.9); color: var(--gray-600);
    display: flex; align-items: center; justify-content: center;
    cursor: grab; opacity: 0; transition: opacity .2s, transform .2s;
    box-shadow: 0 1px 6px rgba(0,0,0,.15); z-index: 5;
}
.desk-doc:hover .desk-rot-handle { opacity: 1; }
.desk-rot-handle:hover { background: #fff; transform: scale(1.15); }
.desk-rot-handle:active { cursor: grabbing; }
.desk-doc-rotating { transition: none !important; }
.desk-doc-rotating .desk-rot-handle { opacity: 1; background: var(--primary); color: #fff; }

/* Desk toolbar */
.desk-toolbar {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 3px; z-index: 999;
    background: rgba(0,0,0,.55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-radius: 10px; padding: 4px;
}
.desk-tb-btn {
    background: transparent; border: none; color: rgba(255,255,255,.75);
    width: 32px; height: 32px; border-radius: 7px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 600; transition: all .15s;
}
.desk-tb-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.desk-tb-active { color: rgba(255,255,255,.35); }
.desk-tb-sep { width: 1px; background: rgba(255,255,255,.15); margin: 4px 2px; }

/* Desk zoom - only docs scale, not overlays */
.desk-view { cursor: grab; }
.desk-view:active { cursor: grabbing; }

.empty-state { color: var(--gray-500); text-align: center; padding: 4rem 1rem; }

@media (max-width: 600px) {
    .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
    .catalog-card-thumb { height: 150px; }
}
