/* Fade In Animation */
@keyframes fadeIn { 
    from { 
        opacity: 0; 
        transform: translateY(30px);
    } 
    to { 
        opacity: 1; 
        transform: translateY(0);
    }
}

/* Cursor Blink */
@keyframes blink { 
    0%,50% {
        opacity:1;
    } 
    51%,100%{
        opacity:0;
    }
}

/* Genie Minimize Animation */
@keyframes genieOut {
    0% { transform: scale(1) translate(0, 0) rotateZ(0deg); opacity: 1; filter: blur(0px); }
    2% { transform: scale(0.99) translate(-0.3vw, 0.2vh) rotateZ(-0.1deg); opacity: 0.995; filter: blur(0px); }
    4% { transform: scale(0.98) translate(-0.7vw, 0.4vh) rotateZ(-0.2deg); opacity: 0.99; filter: blur(0px); }
    6% { transform: scale(0.96) translate(-1.3vw, 0.8vh) rotateZ(-0.4deg); opacity: 0.98; filter: blur(0px); }
    8% { transform: scale(0.95) translate(-2vw, 1.2vh) rotateZ(-0.5deg); opacity: 0.975; filter: blur(0px); }
    10% { transform: scale(0.93) translate(-2.5vw, 1.5vh) rotateZ(-0.6deg); opacity: 0.97; filter: blur(0px); }
    12% { transform: scale(0.91) translate(-3.2vw, 2vh) rotateZ(-0.8deg); opacity: 0.96; filter: blur(0px); }
    14% { transform: scale(0.89) translate(-3.7vw, 2.3vh) rotateZ(-0.9deg); opacity: 0.955; filter: blur(0px); }
    16% { transform: scale(0.87) translate(-4.3vw, 2.7vh) rotateZ(-1.1deg); opacity: 0.945; filter: blur(0px); }
    18% { transform: scale(0.85) translate(-5vw, 3.2vh) rotateZ(-1.3deg); opacity: 0.935; filter: blur(0px); }
    20% { transform: scale(0.82) translate(-6vw, 4vh) rotateZ(-1.5deg); opacity: 0.92; filter: blur(0px); }
    22% { transform: scale(0.8) translate(-6.8vw, 4.5vh) rotateZ(-1.7deg); opacity: 0.91; filter: blur(0.1px); }
    24% { transform: scale(0.78) translate(-7.6vw, 5vh) rotateZ(-1.85deg); opacity: 0.9; filter: blur(0.2px); }
    26% { transform: scale(0.76) translate(-8.2vw, 5.3vh) rotateZ(-1.95deg); opacity: 0.89; filter: blur(0.25px); }
    28% { transform: scale(0.73) translate(-9.3vw, 6vh) rotateZ(-2.2deg); opacity: 0.87; filter: blur(0.4px); }
    30% { transform: scale(0.68) translate(-11vw, 7.5vh) rotateZ(-2.7deg); opacity: 0.84; filter: blur(0.6px); }
    32% { transform: scale(0.65) translate(-12vw, 8.5vh) rotateZ(-3deg); opacity: 0.82; filter: blur(0.7px); }
    34% { transform: scale(0.62) translate(-13vw, 9.2vh) rotateZ(-3.3deg); opacity: 0.8; filter: blur(0.8px); }
    36% { transform: scale(0.59) translate(-14.2vw, 10.2vh) rotateZ(-3.6deg); opacity: 0.77; filter: blur(0.95px); }
    38% { transform: scale(0.56) translate(-15.8vw, 11.5vh) rotateZ(-4deg); opacity: 0.75; filter: blur(1.05px); }
    40% { transform: scale(0.52) translate(-17.5vw, 13vh) rotateZ(-4.5deg); opacity: 0.72; filter: blur(1.2px); }
    42% { transform: scale(0.49) translate(-19vw, 14.5vh) rotateZ(-4.9deg); opacity: 0.69; filter: blur(1.3px); }
    44% { transform: scale(0.47) translate(-20vw, 15.5vh) rotateZ(-5.2deg); opacity: 0.67; filter: blur(1.4px); }
    46% { transform: scale(0.44) translate(-21.5vw, 17vh) rotateZ(-5.6deg); opacity: 0.64; filter: blur(1.55px); }
    48% { transform: scale(0.41) translate(-23vw, 18.5vh) rotateZ(-6deg); opacity: 0.61; filter: blur(1.65px); }
    50% { transform: scale(0.36) translate(-25vw, 20vh) rotateZ(-6.5deg); opacity: 0.58; filter: blur(1.8px); }
    52% { transform: scale(0.33) translate(-26.5vw, 21.5vh) rotateZ(-6.9deg); opacity: 0.55; filter: blur(1.9px); }
    54% { transform: scale(0.31) translate(-28vw, 22.8vh) rotateZ(-7.2deg); opacity: 0.52; filter: blur(2px); }
    56% { transform: scale(0.28) translate(-29.5vw, 24.2vh) rotateZ(-7.6deg); opacity: 0.49; filter: blur(2.15px); }
    58% { transform: scale(0.26) translate(-31vw, 25.8vh) rotateZ(-8deg); opacity: 0.46; filter: blur(2.25px); }
    60% { transform: scale(0.23) translate(-33vw, 28vh) rotateZ(-8.5deg); opacity: 0.42; filter: blur(2.4px); }
    62% { transform: scale(0.21) translate(-34.5vw, 29.5vh) rotateZ(-8.8deg); opacity: 0.39; filter: blur(2.5px); }
    64% { transform: scale(0.19) translate(-36vw, 31vh) rotateZ(-9.1deg); opacity: 0.36; filter: blur(2.6px); }
    66% { transform: scale(0.175) translate(-37.3vw, 32.3vh) rotateZ(-9.4deg); opacity: 0.33; filter: blur(2.7px); }
    68% { transform: scale(0.16) translate(-38.5vw, 33.8vh) rotateZ(-9.7deg); opacity: 0.3; filter: blur(2.85px); }
    70% { transform: scale(0.14) translate(-40vw, 36vh) rotateZ(-10deg); opacity: 0.27; filter: blur(3px); }
    72% { transform: scale(0.125) translate(-41vw, 37.5vh) rotateZ(-10.3deg); opacity: 0.24; filter: blur(3.1px); }
    74% { transform: scale(0.11) translate(-41.8vw, 38.8vh) rotateZ(-10.55deg); opacity: 0.22; filter: blur(3.2px); }
    76% { transform: scale(0.095) translate(-42.5vw, 40vh) rotateZ(-10.75deg); opacity: 0.19; filter: blur(3.35px); }
    78% { transform: scale(0.08) translate(-43.5vw, 41.3vh) rotateZ(-10.95deg); opacity: 0.16; filter: blur(3.5px); }
    80% { transform: scale(0.07) translate(-44.5vw, 42.5vh) rotateZ(-11.1deg); opacity: 0.14; filter: blur(3.6px); }
    82% { transform: scale(0.06) translate(-45.2vw, 43.5vh) rotateZ(-11.25deg); opacity: 0.12; filter: blur(3.7px); }
    84% { transform: scale(0.05) translate(-45.7vw, 44.3vh) rotateZ(-11.4deg); opacity: 0.1; filter: blur(3.8px); }
    86% { transform: scale(0.042) translate(-46.2vw, 45vh) rotateZ(-11.52deg); opacity: 0.08; filter: blur(3.9px); }
    88% { transform: scale(0.035) translate(-46.6vw, 45.7vh) rotateZ(-11.65deg); opacity: 0.065; filter: blur(4px); }
    90% { transform: scale(0.025) translate(-46.8vw, 46.5vh) rotateZ(-11.8deg); opacity: 0.05; filter: blur(4px); }
    92% { transform: scale(0.02) translate(-47vw, 46.9vh) rotateZ(-11.88deg); opacity: 0.04; filter: blur(4.1px); }
    94% { transform: scale(0.015) translate(-47.2vw, 47.2vh) rotateZ(-11.93deg); opacity: 0.03; filter: blur(4.2px); }
    96% { transform: scale(0.01) translate(-47.3vw, 47.3vh) rotateZ(-11.96deg); opacity: 0.02; filter: blur(4.3px); }
    98% { transform: scale(0.005) translate(-47.4vw, 47.4vh) rotateZ(-11.98deg); opacity: 0.01; filter: blur(4.4px); }
    100% { transform: scale(0.001) translate(-47.5vw, 47.5vh) rotateZ(-12deg); opacity: 0; filter: blur(4.5px); }
}

/* Genie Restore Animation */
@keyframes genieIn {
    0% { transform: scale(0.001) translate(-47.5vw, 47.5vh) rotateZ(-12deg); opacity: 0; filter: blur(4.5px); }
    2% { transform: scale(0.005) translate(-47.4vw, 47.4vh) rotateZ(-11.98deg); opacity: 0.01; filter: blur(4.4px); }
    4% { transform: scale(0.01) translate(-47.3vw, 47.3vh) rotateZ(-11.96deg); opacity: 0.02; filter: blur(4.3px); }
    6% { transform: scale(0.015) translate(-47.2vw, 47.2vh) rotateZ(-11.93deg); opacity: 0.03; filter: blur(4.2px); }
    8% { transform: scale(0.02) translate(-47vw, 46.9vh) rotateZ(-11.88deg); opacity: 0.04; filter: blur(4.1px); }
    10% { transform: scale(0.025) translate(-46.8vw, 46.5vh) rotateZ(-11.8deg); opacity: 0.05; filter: blur(4px); }
    12% { transform: scale(0.035) translate(-46.6vw, 45.7vh) rotateZ(-11.65deg); opacity: 0.065; filter: blur(4px); }
    14% { transform: scale(0.042) translate(-46.2vw, 45vh) rotateZ(-11.52deg); opacity: 0.08; filter: blur(3.9px); }
    16% { transform: scale(0.05) translate(-45.7vw, 44.3vh) rotateZ(-11.4deg); opacity: 0.1; filter: blur(3.8px); }
    18% { transform: scale(0.06) translate(-45.2vw, 43.5vh) rotateZ(-11.25deg); opacity: 0.12; filter: blur(3.7px); }
    20% { transform: scale(0.07) translate(-44.5vw, 42.5vh) rotateZ(-11.1deg); opacity: 0.14; filter: blur(3.6px); }
    22% { transform: scale(0.08) translate(-43.5vw, 41.3vh) rotateZ(-10.95deg); opacity: 0.16; filter: blur(3.5px); }
    24% { transform: scale(0.095) translate(-42.5vw, 40vh) rotateZ(-10.75deg); opacity: 0.19; filter: blur(3.35px); }
    26% { transform: scale(0.11) translate(-41.8vw, 38.8vh) rotateZ(-10.55deg); opacity: 0.22; filter: blur(3.2px); }
    28% { transform: scale(0.125) translate(-41vw, 37.5vh) rotateZ(-10.3deg); opacity: 0.24; filter: blur(3.1px); }
    30% { transform: scale(0.14) translate(-40vw, 36vh) rotateZ(-10deg); opacity: 0.27; filter: blur(3px); }
    32% { transform: scale(0.16) translate(-38.5vw, 33.8vh) rotateZ(-9.7deg); opacity: 0.3; filter: blur(2.85px); }
    34% { transform: scale(0.175) translate(-37.3vw, 32.3vh) rotateZ(-9.4deg); opacity: 0.33; filter: blur(2.7px); }
    36% { transform: scale(0.19) translate(-36vw, 31vh) rotateZ(-9.1deg); opacity: 0.36; filter: blur(2.6px); }
    38% { transform: scale(0.21) translate(-34.5vw, 29.5vh) rotateZ(-8.8deg); opacity: 0.39; filter: blur(2.5px); }
    40% { transform: scale(0.23) translate(-33vw, 28vh) rotateZ(-8.5deg); opacity: 0.42; filter: blur(2.4px); }
    42% { transform: scale(0.26) translate(-31vw, 25.8vh) rotateZ(-8deg); opacity: 0.46; filter: blur(2.25px); }
    44% { transform: scale(0.28) translate(-29.5vw, 24.2vh) rotateZ(-7.6deg); opacity: 0.49; filter: blur(2.15px); }
    46% { transform: scale(0.31) translate(-28vw, 22.8vh) rotateZ(-7.2deg); opacity: 0.52; filter: blur(2px); }
    48% { transform: scale(0.33) translate(-26.5vw, 21.5vh) rotateZ(-6.9deg); opacity: 0.55; filter: blur(1.9px); }
    50% { transform: scale(0.36) translate(-25vw, 20vh) rotateZ(-6.5deg); opacity: 0.58; filter: blur(1.8px); }
    52% { transform: scale(0.41) translate(-23vw, 18.5vh) rotateZ(-6deg); opacity: 0.61; filter: blur(1.65px); }
    54% { transform: scale(0.44) translate(-21.5vw, 17vh) rotateZ(-5.6deg); opacity: 0.64; filter: blur(1.55px); }
    56% { transform: scale(0.47) translate(-20vw, 15.5vh) rotateZ(-5.2deg); opacity: 0.67; filter: blur(1.4px); }
    58% { transform: scale(0.49) translate(-19vw, 14.5vh) rotateZ(-4.9deg); opacity: 0.69; filter: blur(1.3px); }
    60% { transform: scale(0.52) translate(-17.5vw, 13vh) rotateZ(-4.5deg); opacity: 0.72; filter: blur(1.2px); }
    62% { transform: scale(0.56) translate(-15.8vw, 11.5vh) rotateZ(-4deg); opacity: 0.75; filter: blur(1.05px); }
    64% { transform: scale(0.59) translate(-14.2vw, 10.2vh) rotateZ(-3.6deg); opacity: 0.77; filter: blur(0.95px); }
    66% { transform: scale(0.62) translate(-13vw, 9.2vh) rotateZ(-3.3deg); opacity: 0.8; filter: blur(0.8px); }
    68% { transform: scale(0.65) translate(-12vw, 8.5vh) rotateZ(-3deg); opacity: 0.82; filter: blur(0.7px); }
    70% { transform: scale(0.68) translate(-11vw, 7.5vh) rotateZ(-2.7deg); opacity: 0.84; filter: blur(0.6px); }
    72% { transform: scale(0.73) translate(-9.3vw, 6vh) rotateZ(-2.2deg); opacity: 0.87; filter: blur(0.4px); }
    74% { transform: scale(0.76) translate(-8.2vw, 5.3vh) rotateZ(-1.95deg); opacity: 0.89; filter: blur(0.25px); }
    76% { transform: scale(0.78) translate(-7.6vw, 5vh) rotateZ(-1.85deg); opacity: 0.9; filter: blur(0.2px); }
    78% { transform: scale(0.8) translate(-6.8vw, 4.5vh) rotateZ(-1.7deg); opacity: 0.91; filter: blur(0.1px); }
    80% { transform: scale(0.82) translate(-6vw, 4vh) rotateZ(-1.5deg); opacity: 0.92; filter: blur(0px); }
    82% { transform: scale(0.85) translate(-5vw, 3.2vh) rotateZ(-1.3deg); opacity: 0.935; filter: blur(0px); }
    84% { transform: scale(0.87) translate(-4.3vw, 2.7vh) rotateZ(-1.1deg); opacity: 0.945; filter: blur(0px); }
    86% { transform: scale(0.89) translate(-3.7vw, 2.3vh) rotateZ(-0.9deg); opacity: 0.955; filter: blur(0px); }
    88% { transform: scale(0.91) translate(-3.2vw, 2vh) rotateZ(-0.8deg); opacity: 0.96; filter: blur(0px); }
    90% { transform: scale(0.93) translate(-2.5vw, 1.5vh) rotateZ(-0.6deg); opacity: 0.97; filter: blur(0px); }
    92% { transform: scale(0.95) translate(-2vw, 1.2vh) rotateZ(-0.5deg); opacity: 0.975; filter: blur(0px); }
    94% { transform: scale(0.96) translate(-1.3vw, 0.8vh) rotateZ(-0.4deg); opacity: 0.98; filter: blur(0px); }
    96% { transform: scale(0.98) translate(-0.7vw, 0.4vh) rotateZ(-0.2deg); opacity: 0.99; filter: blur(0px); }
    98% { transform: scale(0.99) translate(-0.3vw, 0.2vh) rotateZ(-0.1deg); opacity: 0.995; filter: blur(0px); }
    100% { transform: scale(1) translate(0, 0) rotateZ(0deg); opacity: 1; filter: blur(0px); }
}

/* App Icon Animations */
@keyframes iconBounce {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(10deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* GIF Animations */
@keyframes gifFadeIn {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5) rotateZ(-10deg); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotateZ(0deg); }
}

@keyframes gifFadeOut {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotateZ(0deg); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.5) rotateZ(10deg); }
}

/* Animation Classes */
.terminal-container {
    animation: fadeIn 0.6s ease-out;
}

.terminal-container.minimized {
    animation: genieOut 1.4s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
    transform-origin: bottom left;
}

.terminal-container.restoring {
    animation: genieIn 1.4s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
    transform-origin: bottom left;
}

.app-icon.active {
    animation: iconBounce 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.center-gif.active {
    animation: gifFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.center-gif.hiding {
    animation: gifFadeOut 0.5s ease-out forwards;
}

.cursor {
    animation: blink 1s infinite;
}

/* ===== PDF.JS VIEWER STYLES ===== */
#pdf-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f5f5f5;
    overflow: auto;
}

#pdf-canvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 2px;
}

#pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 16px;
    font-style: italic;
}

/* PDF navigation controls */
.pdf-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(0,0,0,0.8);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.pdf-nav-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    transition: all 0.3s ease;
}

.pdf-nav-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.pdf-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Zoom controls */
.pdf-zoom-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    background: rgba(0,0,0,0.8);
    padding: 8px 12px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.zoom-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

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

.zoom-level {
    color: white;
    font-size: 12px;
    margin: 0 8px;
    min-width: 40px;
    text-align: center;
}

/* ===== SCROLLABLE PDF.JS VIEWER STYLES ===== */
#pdf-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #f5f5f5;
    overflow: auto;
    display: flex;
    justify-content: center;
    padding: 20px;
}

#pdf-canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 2px;
    display: block;
}

#pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 16px;
    font-style: italic;
}

/* Enhanced PDF navigation controls */
.pdf-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(0,0,0,0.9);
    padding: 12px 24px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 100;
}

.pdf-nav-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    transition: all 0.3s ease;
    min-width: 80px;
}

.pdf-nav-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.pdf-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Enhanced zoom controls */
.pdf-zoom-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    background: rgba(0,0,0,0.9);
    padding: 10px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 100;
}

.zoom-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

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

.zoom-level {
    color: white;
    font-size: 12px;
    margin: 0 8px;
    min-width: 50px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}

/* Page info display */
.pdf-page-info {
    position: fixed;
    bottom: 30px;
    right: 20px;
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 100;
}

/* Make book pages container scrollable */
.book-pages-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Changed from center to flex-start */
    perspective: 1000px;
    padding: 0; /* Remove padding */
    position: relative;
    min-height: 0;
    overflow: hidden; /* Container doesn't scroll, but content inside does */
}

.book-spread {
    display: flex;
    gap: 0;
    position: relative;
    width: 100%;
    height: 100%;
    max-width: none; /* Remove max width constraint */
    max-height: none; /* Remove max height constraint */
}

.book-page {
    width: 100%;
    height: 100%;
    min-height: 600px;
    background: #fff;
    border-radius: 0; /* Remove border radius for full screen */
    box-shadow: none; /* Remove shadow for cleaner look */
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.page-content {
    flex: 1;
    padding: 0;
    color: #333;
    font-family: 'Georgia', serif;
    font-size: 14px;
    line-height: 1.6;
    overflow: hidden; /* Content will be scrollable via #pdf-container */
    background: #fefefe;
    display: flex;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pdf-controls {
        bottom: 20px;
        padding: 10px 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pdf-nav-btn {
        min-width: 70px;
        font-size: 11px;
        padding: 6px 12px;
    }
    
    .pdf-zoom-controls {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
    }
    
    .zoom-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .pdf-page-info {
        bottom: 80px;
        right: 10px;
        font-size: 11px;
    }
    
    #pdf-container {
        padding: 10px;
    }
}

/* Custom scrollbar for PDF container */
#pdf-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#pdf-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

#pdf-container::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}

#pdf-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.5);
}

/* ===== ENHANCED PDF CONTROLS ===== */
.pdf-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(0,0,0,0.95);
    padding: 12px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.pdf-nav-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 80px;
    letter-spacing: 0.5px;
}

.pdf-nav-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.pdf-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Enhanced zoom controls with download */
.pdf-zoom-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 6px;
    background: rgba(0,0,0,0.95);
    padding: 10px 12px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.zoom-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.zoom-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.download-btn {
    background: linear-gradient(135deg, #1DB954, #1ed760);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-left: 4px;
}

.download-btn:hover {
    background: linear-gradient(135deg, #1ed760, #4cd964);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.4);
}

.zoom-level {
    color: white;
    font-size: 12px;
    margin: 0 10px;
    min-width: 50px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

/* Page info display */
.pdf-page-info {
    position: fixed;
    bottom: 30px;
    right: 20px;
    background: rgba(0,0,0,0.95);
    color: white;
    padding: 10px 16px;
    border-radius: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* Scroll position indicator */
.pdf-scroll-info {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0,0,0,0.95);
    color: white;
    padding: 10px 16px;
    border-radius: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    display: none;
}

/* Enhanced PDF container with smooth scrolling */
#pdf-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #f5f5f5;
    overflow: auto;
    display: flex;
    justify-content: center;
    padding: 20px;
    scroll-behavior: smooth;
}

#pdf-canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 4px;
    display: block;
    transition: transform 0.2s ease;
}

/* Scrollbar styling */
#pdf-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

#pdf-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 6px;
}

#pdf-container::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: content-box;
}

#pdf-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.5);
    border: 2px solid transparent;
    background-clip: content-box;
}

#pdf-container::-webkit-scrollbar-corner {
    background: transparent;
}

/* Loading animation */
#pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 16px;
    font-style: italic;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pdf-controls {
        bottom: 20px;
        padding: 10px 15px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }
    
    .pdf-nav-btn {
        min-width: 70px;
        font-size: 11px;
        padding: 6px 12px;
    }
    
    .pdf-zoom-controls {
        top: 10px;
        right: 10px;
        padding: 8px 10px;
        gap: 4px;
    }
    
    .zoom-btn, .download-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .pdf-page-info {
        bottom: 80px;
        right: 10px;
        font-size: 11px;
        padding: 8px 12px;
    }
    
    .pdf-scroll-info {
        top: 10px;
        left: 10px;
        font-size: 11px;
        padding: 8px 12px;
    }
    
    #pdf-container {
        padding: 10px;
    }
}

/* Quick scroll buttons */
.quick-scroll {
    position: fixed;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.quick-scroll-btn {
    background: rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.quick-scroll-btn:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.quick-scroll-up {
    bottom: 120px;
}

.quick-scroll-down {
    bottom: 70px;
}

#pdf-container {
    display: block;
    overflow: auto;
    height: 100%;
    width: 100%;
    padding: 20px;
    background: #f5f5f5;
    position: relative;
}

