/* ============================================================
   Profs Library — Frontend Styles
   Library grid + PDF Reader
   ============================================================ */

:root {
    --profs-accent:      #1a3a5c;
    --profs-accent-light:#e8f0fa;
    --profs-text:        #1a1a2e;
    --profs-text-light:  #64748b;
    --profs-border:      #e2e8f0;
    --profs-radius:      10px;
    --profs-shadow:      0 4px 16px rgba(0,0,0,.10);
    --profs-reader-bg:   #1a1a2e;
}

/* ============================================================
   LIBRARY PAGE
   ============================================================ */

.profs-library-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    font-family: inherit;
}

.profs-library-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 28px;
    border-bottom: 2px solid var(--profs-accent);
    padding-bottom: 12px;
}

.profs-library-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--profs-accent);
    margin: 0;
}

.profs-library-count {
    font-size: 13px;
    color: var(--profs-text-light);
    background: var(--profs-accent-light);
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
}

/* Empty state */
.profs-library-empty {
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: var(--profs-radius);
    border: 2px dashed var(--profs-border);
}

.profs-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.profs-library-empty h3 {
    font-size: 20px;
    color: var(--profs-text);
    margin-bottom: 8px;
}

.profs-library-empty p {
    color: var(--profs-text-light);
    margin-bottom: 20px;
}

/* Book Grid */
.profs-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

@media (max-width: 480px) {
    .profs-books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

/* Book Card */
.profs-book-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--profs-radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--profs-shadow);
    transition: transform .2s, box-shadow .2s;
}

.profs-book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
}

/* Cover */
.profs-book-cover-link { display: block; text-decoration: none; }

.profs-book-cover-wrap {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: #e8edf2;
}

.profs-book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}

.profs-book-card:hover .profs-book-cover {
    transform: scale(1.05);
}

.profs-book-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26,58,92,.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
}

.profs-book-card:hover .profs-book-overlay {
    opacity: 1;
}

.profs-read-icon {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    background: rgba(255,255,255,.15);
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid rgba(255,255,255,.6);
}

/* Progress bar */
.profs-progress-bar-wrap {
    height: 4px;
    background: #e2e8f0;
}

.profs-progress-bar {
    height: 100%;
    background: var(--profs-accent);
    transition: width .4s ease;
}

/* Book info */
.profs-book-info {
    padding: 12px 12px 6px;
    flex: 1;
}

.profs-book-title {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.35;
    color: var(--profs-text);
}

.profs-book-title a {
    color: inherit;
    text-decoration: none;
}

.profs-book-title a:hover { color: var(--profs-accent); }

.profs-book-author {
    font-size: 11px;
    color: var(--profs-text-light);
    margin: 0 0 4px;
}

.profs-book-progress-text {
    font-size: 11px;
    color: var(--profs-text-light);
    margin: 0;
}

/* CTA button on card */
.profs-read-btn {
    display: block;
    margin: 8px 12px 12px;
    padding: 8px;
    background: var(--profs-accent);
    color: #fff;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    text-decoration: none;
    letter-spacing: .03em;
    transition: background .2s;
}

.profs-read-btn:hover { background: #0f2540; color: #fff; }

/* Library footer */
.profs-library-footer {
    text-align: center;
    margin-top: 36px;
}

/* Buttons */
.profs-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--profs-accent);
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s;
    border: none;
    cursor: pointer;
}

.profs-btn:hover { background: #0f2540; color: #fff; }

.profs-btn-outline {
    background: transparent;
    border: 2px solid var(--profs-accent);
    color: var(--profs-accent);
}

.profs-btn-outline:hover { background: var(--profs-accent); color: #fff; }

.profs-btn-sm { padding: 6px 14px; font-size: 12px; }

/* Library notice (not logged in) */
.profs-library-notice {
    text-align: center;
    padding: 48px 20px;
}

/* ============================================================
   PDF READER — Full Screen Layout
   ============================================================ */

.profs-reader-body {
    background: var(--profs-reader-bg);
    user-select: none;
    -webkit-user-select: none;
}

.profs-reader-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header bar */
.profs-reader-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--profs-accent);
    color: #fff;
    padding: 0 16px;
    height: 52px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    z-index: 10;
    gap: 12px;
}

.profs-reader-header-left,
.profs-reader-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.profs-reader-header-right { justify-content: flex-end; }

.profs-reader-header-center {
    flex: 1;
    text-align: center;
    overflow: hidden;
}

.profs-reader-back {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background .2s;
}

.profs-reader-back:hover { background: rgba(255,255,255,.15); color: #fff; }

.profs-reader-brand,
.profs-reader-logo {
    font-size: 14px;
    font-weight: 700;
    opacity: .9;
}

.profs-reader-logo { height: 28px; object-fit: contain; }

.profs-reader-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.profs-reader-btn {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    position: relative;
    transition: background .2s;
}

.profs-reader-btn:hover { background: rgba(255,255,255,.25); }

.profs-notes-badge {
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    margin-left: 4px;
    display: inline-block;
    vertical-align: top;
    margin-top: -2px;
}

.profs-progress-indicator {
    background: rgba(255,255,255,.15);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

/* Main reader area */
.profs-reader-main {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* PDF iframe container */
.profs-reader-frame-wrap {
    flex: 1;
    position: relative;
    background: #2c2c54;
    overflow: hidden;
}

.profs-reader-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Shield overlay — prevents right-click on iframe (transparent, pointer-events none during reading) */
.profs-iframe-shield {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none; /* transparent to clicks, only blocks context menu at body level */
}

/* Notes Panel */
.profs-notes-panel {
    width: 320px;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .3s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,.2);
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 20;
}

.profs-notes-panel.open {
    transform: translateX(0);
}

.profs-notes-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--profs-accent);
    color: #fff;
    flex-shrink: 0;
}

.profs-notes-panel-header h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

.profs-panel-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.8);
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 4px;
    transition: background .2s;
}

.profs-panel-close:hover { background: rgba(255,255,255,.2); color: #fff; }

.profs-notes-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profs-add-note-form {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.profs-form-row-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

.profs-notes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profs-note-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 12px;
    border-left-width: 4px;
}

.profs-note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.profs-note-page {
    font-size: 11px;
    font-weight: 700;
    color: var(--profs-accent);
    background: var(--profs-accent-light);
    padding: 2px 8px;
    border-radius: 10px;
}

.profs-note-delete {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 3px;
    line-height: 1;
    transition: color .2s;
}

.profs-note-delete:hover { color: #e74c3c; }

.profs-note-text {
    font-size: 13px;
    color: #444;
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
}

.profs-notes-empty {
    color: #aaa;
    font-size: 13px;
    text-align: center;
    padding: 24px 0;
}

/* ============================================================
   MOBILE ADJUSTMENTS
   ============================================================ */

@media (max-width: 600px) {
    .profs-reader-back-text { display: none; }
    .profs-reader-brand     { display: none; }
    .profs-notes-panel      { width: 100%; }
    .profs-reader-header    { padding: 0 10px; gap: 6px; }
    .profs-reader-header-left,
    .profs-reader-header-right { min-width: auto; }
}
