/* Custom Typography & Base */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

h1, h2, h3, h4, .font-heading {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Publisher Tactile 3D Buttons */
.publisher-btn {
    position: relative;
    border-radius: 1.25rem;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 125px;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
}

.publisher-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.4), 0 15px 20px -3px rgba(0, 0, 0, 0.4);
    filter: brightness(1.08);
}

.publisher-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4), 0 5px 10px -3px rgba(0, 0, 0, 0.3);
    filter: brightness(0.95);
}

/* Topic / Book Card */
.book-card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 1.25rem;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.15s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.book-card:hover {
    border-color: #f59e0b;
    background: #162032;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -2px rgba(245, 158, 11, 0.1);
}

/* Sub-topic Filter Pill */
.subtopic-pill {
    padding: 0.4rem 0.9rem;
    border-radius: 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid #334155;
    background: #1e293b;
    color: #cbd5e1;
    transition: all 0.15s ease;
    cursor: pointer;
}

.subtopic-pill:hover {
    background: #334155;
    color: #fff;
}

.subtopic-pill.active {
    background: #f59e0b;
    color: #0f172a;
    border-color: #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #090d16;
}

::-webkit-scrollbar-thumb {
    background: #27354a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3d506d;
}

/* Lesson / Subject Switcher Tabs */
.lesson-tab {
    position: relative;
    border-radius: 1.15rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #0f172a;
    border: 1.5px solid #1e293b;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    user-select: none;
    -webkit-user-select: none;
}

.lesson-tab:hover {
    border-color: #334155;
    color: #f8fafc;
    transform: translateY(-1px);
}

.lesson-tab:active {
    transform: translateY(2px);
}

.lesson-tab.active-mat2 {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.08));
    border-color: #f59e0b;
    color: #fef3c7;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.25), 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

.lesson-tab.active-mat1 {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(37, 99, 235, 0.08));
    border-color: #3b82f6;
    color: #dbeafe;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.25), 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

.lesson-tab.active-geo {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(5, 150, 105, 0.08));
    border-color: #10b981;
    color: #d1fae5;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.25), 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

.lesson-tab.active-all {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(124, 58, 237, 0.08));
    border-color: #8b5cf6;
    color: #ede9fe;
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.25), 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

/* Category Tactile Tiles (Original App Model) */
.category-btn {
    position: relative;
    border-radius: 1.25rem;
    padding: 1.2rem 1.1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 125px;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.4), 0 15px 20px -3px rgba(0, 0, 0, 0.4);
    filter: brightness(1.08);
}

.category-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4), 0 5px 10px -3px rgba(0, 0, 0, 0.3);
    filter: brightness(0.95);
}

/* PDF Viewport & Canvas Overlay (PDF.js) */
#pdfViewportContainer {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: #090d16;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
}

#pdfCanvasWrapper {
    position: relative;
    margin: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.7);
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
}

#pdfRenderCanvas {
    display: block;
    max-width: none;
}

#modalDrawingCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}
