/* Course Proof Viewer - Styles */

.cpv-btn-wrapper {
    margin: 16px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Trigger Button ── */
.cpv-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: 2px solid currentColor;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    outline: none;
}
.cpv-trigger-btn:hover  { opacity: 0.85; transform: translateY(-1px); }
.cpv-trigger-btn:active { transform: translateY(0); }
.cpv-trigger-btn.cpv-open { opacity: 0.7; }

/* ── Panel wrapper ── */
.cpv-panel-wrapper {
    width: 100%;
    margin: 0 0 30px 0;
}
.cpv-panel-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Viewer Container — ALWAYS 500px, never changes ── */
.cpv-viewer-container {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    background: #fff;
    position: relative;
    animation: cpvSlideIn 0.25s ease;
    height: 500px !important;
    min-height: 500px !important;
    max-height: 500px !important;
    display: flex;
    flex-direction: column;
}
@keyframes cpvSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Loading ── */
.cpv-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    gap: 16px;
    flex: 1;
}
.cpv-spinner {
    width: 36px; height: 36px;
    border: 3px solid #eee;
    border-top-color: #333;
    border-radius: 50%;
    animation: cpvSpin 0.7s linear infinite;
}
@keyframes cpvSpin { to { transform: rotate(360deg); } }

/* ── Error ── */
.cpv-error {
    padding: 24px;
    background: #fff3f3;
    border-left: 4px solid #e53935;
    color: #b71c1c;
    font-size: 14px;
}

/* ── Summary Bar ── */
.cpv-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #ececec;
    flex-shrink: 0;
}
.cpv-folder-title {
    font-size: 15px;
    font-weight: 700;
    color: #111;
    flex: 1;
    min-width: 140px;
}
.cpv-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.cpv-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}
.cpv-stat-val {
    font-size: 15px;
    font-weight: 700;
    color: #111;
    line-height: 1;
}
.cpv-stat-lbl {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Breadcrumb ── */
.cpv-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px 20px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: #555;
    flex-shrink: 0;
}
.cpv-breadcrumb-item {
    color: #333;
    font-weight: 500;
}
.cpv-breadcrumb-item.cpv-bc-nav {
    cursor: pointer;
    color: #1a73e8;
}
.cpv-breadcrumb-item.cpv-bc-nav:hover { text-decoration: underline; }
.cpv-breadcrumb-item.cpv-current {
    color: #333;
    cursor: default;
    font-weight: 600;
}
.cpv-breadcrumb-sep { color: #bbb; user-select: none; padding: 0 2px; }

/* ── List Header ── */
.cpv-list-header {
    display: grid;
    grid-template-columns: 1fr 100px 140px 100px;
    padding: 8px 20px;
    background: #f5f5f5;
    border-bottom: 1px solid #e8e8e8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #777;
    flex-shrink: 0;
}

/* ── Scrollable area — takes remaining height ── */
.cpv-list-scroll {
    overflow-y: auto;
    flex: 1;
    position: relative;
    min-height: 0;
}

/* ── File Rows ── */
.cpv-file-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cpv-file-row {
    display: grid;
    grid-template-columns: 1fr 100px 140px 100px;
    align-items: center;
    padding: 11px 20px;
    border-bottom: 1px solid #f2f2f2;
    transition: background 0.15s;
    cursor: default;
    user-select: none;
}
.cpv-file-row:last-child { border-bottom: none; }
.cpv-file-row:hover { background: #fafafa; }
.cpv-file-row.cpv-is-folder { cursor: pointer; }
.cpv-file-row.cpv-is-folder:hover { background: #f0f6ff; }

.cpv-file-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: #222;
    font-weight: 500;
    min-width: 0;
}
.cpv-file-name-text {
    word-break: break-word;
    line-height: 1.4;
}
.cpv-is-folder .cpv-file-name { color: #1a73e8; font-weight: 600; }

.cpv-file-type  { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
.cpv-file-date  { font-size: 11.5px; color: #999; }
.cpv-file-size  { font-size: 12px; color: #666; text-align: right; }

/* ── Icons ── */
.cpv-icon {
    width: 22px; height: 22px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* ── WATERMARK — large, dark, full coverage ── */
.cpv-watermark {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 20;
    overflow: hidden;
}
.cpv-watermark-inner {
    position: absolute;
    top: -100%;
    left: -50%;
    width: 300%;
    height: 400%;
    transform: rotate(-28deg);
    pointer-events: none;
}
.cpv-watermark-row {
    display: flex;
    gap: 60px;
    margin-bottom: 55px;
    white-space: nowrap;
}
.cpv-watermark-word {
    font-size: 28px;
    font-weight: 900;
    color: rgba(0,0,0,0.09);
    text-transform: lowercase;
    letter-spacing: 3px;
    user-select: none;
    pointer-events: none;
    flex-shrink: 0;
}

/* ── Empty state ── */
.cpv-empty {
    padding: 40px 20px;
    text-align: center;
    color: #aaa;
    font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .cpv-list-header,
    .cpv-file-row { grid-template-columns: 1fr 70px; }
    .cpv-list-header .cpv-col-type,
    .cpv-list-header .cpv-col-date,
    .cpv-file-type,
    .cpv-file-date { display: none; }
    .cpv-stats { gap: 12px; }
    .cpv-summary-bar { padding: 12px 14px; }
    .cpv-file-row { padding: 10px 14px; }
    .cpv-breadcrumb { padding: 8px 14px; }
    .cpv-viewer-container {
        height: 420px !important;
        min-height: 420px !important;
        max-height: 420px !important;
    }
}
