/* ========================================
   JOLLYGOOD+ Slide Library - Styles
   Modern dark theme with glassmorphism
======================================== */

/* CSS Variables */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ========================================
   Header
======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 16px !important;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-icon {
    font-size: 1.2rem;
    -webkit-text-fill-color: initial;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.nav-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

/* User Info & Auth */
.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info.hidden {
    display: none;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.logout-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.logout-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.login-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: #333;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.login-btn:hover {
    box-shadow: var(--shadow-soft);
}

.login-btn img {
    width: 18px;
    height: 18px;
}

/* ========================================
   Main Content
======================================== */
.main {
    padding-top: 100px;
    min-height: 100vh;
}

.library {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.library-header {
    text-align: center;
    margin-bottom: 3rem;
}

.library-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ========================================
   Search and Filter
======================================== */
.search-filter-section {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin-bottom: 1rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.875rem 2.5rem 0.875rem 3rem;
    background: rgba(30, 30, 40, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.clear-search-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem;
}

.clear-search-btn:hover {
    color: var(--text-primary);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-btn {
    padding: 0.375rem 0.875rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.tag-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: transparent;
    color: white;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ========================================
   PDF Grid
======================================== */
.pdf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.pdf-card {
    position: relative;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.pdf-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.pdf-card-thumbnail {
    aspect-ratio: 4/3;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pdf-card-thumbnail canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pdf-card-info {
    padding: 1.25rem;
}

.pdf-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pdf-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.pdf-card-pages {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pdf-card-likes {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #f87171;
}

/* ========================================
   Modal Base
======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

/* ========================================
   PDF Viewer Modal
======================================== */
.viewer-container {
    position: relative;
    width: 95%;
    height: 95%;
    max-width: 1600px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
}

.viewer-title {
    font-size: 1.25rem;
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.watch-video-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin-right: 1.5rem;
    background: #ff0000;
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.watch-video-btn:hover {
    background: #cc0000;
    transform: translateY(-2px);
}

.watch-video-btn .play-icon {
    font-size: 1.2rem;
}

.watch-video-btn.hidden {
    display: none;
}

.viewer-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.close-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
}

/* Like Button */
.like-btn {
    width: auto;
    padding: 0 0.75rem;
    gap: 0.4rem;
}

.like-btn .like-icon {
    font-size: 1.2rem;
    transition: var(--transition);
}

.like-btn.liked {
    background: rgba(239, 68, 107, 0.2);
    border-color: #ef446b;
}

.like-btn.liked .like-icon {
    color: #ef446b;
}

.like-count {
    font-size: 0.85rem;
    font-weight: 600;
}

.viewer-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.pdf-info-sidebar {
    width: 260px;
    padding: 1.25rem;
    background: var(--bg-glass);
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    flex-shrink: 0;
}

.info-section {
    margin-bottom: 1.5rem;
}

.info-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.info-section p {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.link-list {
    list-style: none;
}

.link-list li {
    margin-bottom: 0.5rem;
}

.link-list a {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: var(--transition);
}

.link-list a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: auto;
    background: var(--bg-primary);
}

#pdfCanvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: var(--shadow-soft);
}

.viewer-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-glass);
    border-top: 1px solid var(--border-color);
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.control-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-indicator {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
    text-align: center;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

#zoomSlider {
    width: 120px;
    accent-color: var(--accent-primary);
}

/* ========================================
   CTA Section
======================================== */
.cta-section {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.cta-section.hidden {
    display: none;
}

.close-cta-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 20;
}

.close-cta-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.cta-content {
    text-align: center;
    padding: 3rem;
    max-width: 600px;
}

.cta-content h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.cta-content>p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.cta-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.cta-btn.primary {
    background: var(--accent-gradient);
    color: white;
}

.cta-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.cta-btn.secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.cta-btn.secondary:hover {
    border-color: var(--accent-primary);
}

.cta-btn.outline {
    background: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
    margin-top: 1rem;
}

.cta-btn.outline:hover {
    background: var(--accent-primary);
    color: white;
}

.cta-contact {
    margin-bottom: 2rem;
}

.cta-contact a {
    color: var(--accent-primary);
    text-decoration: none;
}

.cta-contact a:hover {
    text-decoration: underline;
}

.company-info {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.company-info p {
    margin-bottom: 0.25rem;
}

/* ========================================
   Admin Modal
======================================== */
.admin-container {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90%;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
}

.admin-header h2 {
    font-size: 1.5rem;
}

.admin-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.admin-section {
    margin-bottom: 2rem;
}

.admin-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.admin-pdf-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-pdf-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: opacity 0.2s, border-top 0.2s;
}

.admin-pdf-item.dragging {
    opacity: 0.5;
}

.admin-pdf-item .drag-handle {
    cursor: grab;
    padding: 0 10px;
    font-size: 20px;
    color: #888;
    user-select: none;
}

.admin-pdf-item .drag-handle:active {
    cursor: grabbing;
}

.admin-pdf-item canvas {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.admin-pdf-info {
    flex: 1;
}

.admin-pdf-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.admin-pdf-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.admin-pdf-stats {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.admin-pdf-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.admin-pdf-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-btn,
.delete-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.edit-btn {
    background: var(--accent-primary);
    color: white;
}

.edit-btn:hover {
    background: var(--accent-secondary);
}

.delete-btn {
    background: transparent;
    color: #ef4444;
    border: 1px solid #ef4444;
}

.delete-btn:hover {
    background: #ef4444;
    color: white;
}

/* File Input */
.file-input {
    display: none;
}

.file-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--bg-glass);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.file-label:hover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.selected-file-name {
    display: block;
    margin-top: 0.5rem;
    color: var(--accent-primary);
    font-size: 0.9rem;
}

.upload-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-glass);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    transition: width 0.3s ease;
}

#progressText {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-width: 40px;
}

.upload-compact {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.file-label-compact {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.file-label-compact:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.upload-btn-compact {
    padding: 0.5rem 1rem;
    background: var(--success);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.upload-btn-compact:hover {
    opacity: 0.9;
}

/* ========================================
   Edit Modal
======================================== */
.edit-container {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 90%;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
}

.edit-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-textarea {
    resize: vertical;
    font-family: inherit;
}

.ai-generate-btn {
    margin-left: 0.5rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: white;
    border: 2px solid rgba(139, 92, 246, 0.5);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3);
}

.ai-generate-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.5);
    border-color: rgba(236, 72, 153, 0.6);
}

.ai-generate-btn.loading {
    pointer-events: none;
    opacity: 0.8;
    animation: pulse 1.5s infinite;
}

.ai-generate-btn.loading::after {
    content: ' ⏳';
    animation: spin 1s linear infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

@keyframes spin {
    0% {
        content: ' ⏳';
    }

    33% {
        content: ' ⌛';
    }

    66% {
        content: ' ⏳';
    }
}

.ogp-page-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
}

.ogp-page-thumb {
    position: relative;
    aspect-ratio: 4/3;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.ogp-page-thumb:hover {
    border-color: var(--text-muted);
}

.ogp-page-thumb.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.ogp-page-thumb canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ogp-page-number {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.edit-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.save-btn,
.cancel-btn {
    padding: 0.75rem 2rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.save-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.cancel-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.cancel-btn:hover {
    background: var(--bg-glass);
}

/* ========================================
   Toast Notification
======================================== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 2rem;
    box-shadow: var(--shadow-soft);
    z-index: 2000;
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.hidden {
    display: block;
}

/* Video Player Integration */
.watch-video-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ff0000;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    /* Ensure it doesn't shrink */
    flex-shrink: 0;
}

.watch-video-btn:hover {
    background: #cc0000;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.watch-video-btn.hidden {
    display: none;
}

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 20;
    /* Above canvas */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.video-container.hidden {
    display: none;
}

.close-video-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.close-video-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.video-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    /* Max width for vertical video on desktop to avoid being too huge? 
       Actually user asked for "slide display screen entire playback", 
       so full width/height matching the container is best, 
       but we might want to respect aspect ratio if possible.
       For now, let's make it responsive. */
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Adjustments for mobile */
@media (max-width: 768px) {
    .watch-video-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 768px) {
    .header-content {
        padding: 1rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .library {
        padding: 1rem;
    }

    .library-header h2 {
        font-size: 1.8rem;
    }

    .pdf-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .viewer-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .viewer-body {
        flex-direction: column;
    }

    .pdf-info-sidebar {
        width: 100%;
        max-height: 150px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .viewer-controls {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .zoom-controls {
        width: 100%;
        justify-content: center;
    }

    .cta-links {
        flex-direction: column;
    }
}

/* ========================================
   Fullscreen Mode
======================================== */
.viewer-container:fullscreen {
    width: 100%;
    height: 100%;
    max-width: 100%;
    border-radius: 0;
    border: none;
    background: var(--bg-primary);
}

.viewer-container:fullscreen .viewer-header {
    display: none;
}

.viewer-container:fullscreen .pdf-info-sidebar {
    display: none;
}

.viewer-container:fullscreen .viewer-body {
    height: 100%;
}

.viewer-container:fullscreen .canvas-wrapper {
    padding: 0;
    height: calc(100% - 60px);
}

.viewer-container:fullscreen .viewer-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
}

.viewer-container:fullscreen #pdfCanvas {
    max-width: 100%;
    max-height: 100%;
}

/* Webkit (Safari, Chrome) fullscreen support */
.viewer-container:-webkit-full-screen {
    width: 100%;
    height: 100%;
    max-width: 100%;
    border-radius: 0;
    border: none;
    background: var(--bg-primary);
}

.viewer-container:-webkit-full-screen .viewer-header {
    display: none;
}

.viewer-container:-webkit-full-screen .pdf-info-sidebar {
    display: none;
}

.viewer-container:-webkit-full-screen .viewer-body {
    height: 100%;
}

.viewer-container:-webkit-full-screen .canvas-wrapper {
    padding: 0;
    height: calc(100% - 60px);
}

.viewer-container:-webkit-full-screen .viewer-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
}

/* ========================================
   Footer
======================================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem 3rem;
    list-style: none;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.8rem;
}