:root {
    --primary-blue: #4361ee;
    --primary-purple: #7209b7;
    --app-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-radius: 16px;
    --shadow-sm: 0 4px 12px rgba(3, 2, 2, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --header-height: 70px;
}

[data-bs-theme="dark"] {
    --app-bg: #121212;
    --card-bg: #1e1e1e;
    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Base Styles */
body {
    background-color: var(--app-bg);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    padding-bottom: 80px;
    -webkit-overflow-scrolling: touch;
    min-height: 100vh;
    transition: background-color 0.3s ease;
}

/* =========================================================
   WHAT'S NEW — PREMIUM STATUS UI
   ========================================================= */

.whats-new-status-launcher {
    position: relative;
    width: 100%;
    min-height: 96px;
    display: flex;
    align-items: center;
    padding: 13px 18px;
    border: 1px solid rgba(37, 211, 102, .14);
    border-radius: 22px;
    background:
        radial-gradient(circle at 100% 0%, rgba(37, 211, 102, .10), transparent 38%),
        linear-gradient(135deg, rgba(37, 211, 102, .045), rgba(67, 97, 238, .035) 55%, rgba(114, 9, 183, .03)),
        var(--card-bg);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .055);
    cursor: pointer;
    user-select: none;
    overflow: hidden;
    isolation: isolate;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.whats-new-status-launcher::before {
    content: "";
    position: absolute;
    top: -90px;
    right: -70px;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 211, 102, .12), transparent 68%);
    pointer-events: none;
    z-index: -1;
}

.whats-new-status-launcher:hover {
    transform: translateY(-3px);
    border-color: rgba(37, 211, 102, .30);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .095);
}

.whats-new-status-launcher:focus-visible {
    outline: 3px solid rgba(37, 211, 102, .22);
    outline-offset: 3px;
}

.whats-new-status-launcher:active {
    transform: scale(.985);
}

/* Status avatar */
.whats-new-status-avatar-wrapper {
    position: relative;
    width: 70px;
    height: 70px;
    min-width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whats-new-status-avatar-ring {
    position: absolute;
    inset: 0;
    padding: 3px;
    border-radius: 50%;
    background: conic-gradient(#25d366, #128c7e 28%, #25d366 55%, #075e54 78%, #25d366);
    animation: whatsNewRingRotate 5s linear infinite;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, .07), 0 6px 20px rgba(37, 211, 102, .18);
}

.whats-new-status-avatar-ring::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--card-bg);
}

@keyframes whatsNewRingRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.whats-new-status-avatar {
    position: relative;
    z-index: 1;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #075e54, #128c7e 55%, #25d366);
    border: 3px solid var(--card-bg);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .16);
}

.whats-new-status-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.whats-new-status-avatar-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.whats-new-status-avatar-icon i {
    font-size: 27px;
}

.whats-new-status-count {
    position: absolute;
    right: -2px;
    bottom: -1px;
    min-width: 25px;
    height: 25px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    background: #25d366;
    color: #fff;
    border: 3px solid var(--card-bg);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 3px 9px rgba(0, 0, 0, .16);
}

/* Launcher text */
.whats-new-status-info {
    position: relative;
    flex: 1;
    min-width: 0;
    margin-left: 18px;
}

.whats-new-status-title {
    font-size: 17px;
    font-weight: 750;
    line-height: 1.25;
    color: var(--text-primary);
}

.whats-new-status-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.whats-new-status-dot {
    width: 7px;
    height: 7px;
    min-width: 7px;
    border-radius: 50%;
    background: #25d366;
    box-shadow: 0 0 0 4px rgba(37, 211, 102, .10);
}

.whats-new-status-arrow {
    width: 40px;
    height: 40px;
    min-width: 40px;
    margin-left: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 211, 102, .08);
    color: #128c7e;
    transition: transform .25s ease, background .25s ease;
}

.whats-new-status-arrow i {
    font-size: 17px;
}

.whats-new-status-launcher:hover .whats-new-status-arrow {
    transform: translateX(4px);
    background: rgba(37, 211, 102, .16);
}

/* =========================================================
   STATUS VIEWER
   ========================================================= */

#whatsNewModal {
    --bs-modal-bg: transparent;
    z-index: 1080;
}

#whatsNewModal .modal-dialog {
    width: min(430px, calc(100vw - 28px));
    max-width: 430px;
    margin: 1rem auto;
}

#whatsNewModal .modal-content {
    position: relative;
    width: 100%;
    min-height: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 24px !important;
    overflow: hidden;
    background: #050505;
    box-shadow: 0 30px 100px rgba(0, 0, 0, .55);
}

#whatsNewModal .modal-backdrop {
    background: #000;
}

/* Story area */
.whats-new-status {
    position: relative;
    width: 100%;
    height: min(760px, 88vh);
    min-height: 560px;
    overflow: hidden;
    background: #050505;
}

.whats-new-status::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .08), transparent 22%, transparent 70%, rgba(0, 0, 0, .14));
    z-index: 15;
}

/* Segmented story progress */
.whats-new-progress {
    position: absolute;
    top: 10px;
    left: 11px;
    right: 11px;
    height: 4px;
    display: flex;
    gap: 4px;
    z-index: 70;
}

.whats-new-progress-segment {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    height: 4px;
    overflow: hidden;
    border-radius: 20px;
    background: rgba(255, 255, 255, .30);
}

.whats-new-progress-segment::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 0;
    background: #fff;
    border-radius: inherit;
    transform-origin: left center;
}

.whats-new-progress-segment.active::after {
    width: var(--progress, 0%);
}

.whats-new-progress-segment.completed::after {
    width: 100%;
}

/* Backward compatibility if older JS is still present */
.whats-new-progress-bar {
    height: 100%;
    width: 0%;
    background: #fff;
    border-radius: 20px;
}

/* Story header */
.whats-new-modal-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 28px 16px 20px;
    color: #fff;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .82), rgba(0, 0, 0, .38) 55%, transparent);
    pointer-events: none;
}

.whats-new-modal-header>* {
    pointer-events: auto;
}

.whats-new-modal-header .btn-close {
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    opacity: 1;
    filter: brightness(0) invert(1);
    background-color: rgba(255, 255, 255, .12);
    background-size: 13px;
    backdrop-filter: blur(8px);
    transition: background-color .2s ease, transform .2s ease;
}

.whats-new-modal-header .btn-close:hover {
    background-color: rgba(255, 255, 255, .22);
    transform: scale(1.05);
}

.whats-new-modal-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #075e54, #25d366);
    border: 2px solid rgba(255, 255, 255, .88);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

.whats-new-modal-avatar i {
    font-size: 17px;
}

/* Story media */
.whats-new-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050505;
    overflow: hidden;
    z-index: 5;
}

.whats-new-main-image,
.whats-new-main-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background: #050505;
}

.whats-new-main-video {
    object-position: center;
}

/* Text-only story */
.whats-new-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 34px 190px;
    background:
        radial-gradient(circle at 50% 28%, rgba(37, 211, 102, .95) 0%, rgba(18, 140, 126, .92) 23%, rgba(7, 94, 84, .98) 52%, #021c18 100%);
    color: #fff;
}

.whats-new-placeholder i {
    font-size: 76px;
    opacity: .95;
    filter: drop-shadow(0 12px 25px rgba(0, 0, 0, .35));
}

/* Story content */
.whats-new-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 110px 25px 28px;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, .96) 0%, rgba(0, 0, 0, .80) 32%, rgba(0, 0, 0, .25) 72%, transparent 100%);
}

.whats-new-text h4 {
    margin: 0 0 8px;
    font-size: 23px;
    font-weight: 750;
    line-height: 1.25;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}

.whats-new-text p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .92);
    white-space: pre-wrap;
    word-break: break-word;
}

#whatsNewLinkContainer {
    margin-top: 17px;
}

#whatsNewLinkContainer .btn {
    border: 0;
    padding: 9px 18px;
    border-radius: 50px;
    background: #25d366;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 5px 18px rgba(37, 211, 102, .25);
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

#whatsNewLinkContainer .btn:hover {
    transform: translateY(-2px);
    background: #128c7e;
    box-shadow: 0 8px 22px rgba(37, 211, 102, .32);
}

/* Story navigation */
.whats-new-nav {
    position: absolute;
    top: 50%;
    z-index: 55;
    width: 46px;
    height: 46px;
    margin-top: -23px;
    border: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .28);
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background .2s ease, transform .2s ease, opacity .2s ease;
}

.whats-new-nav:hover {
    background: rgba(0, 0, 0, .58);
}

.whats-new-nav:active {
    transform: scale(.90);
}

.whats-new-nav i {
    font-size: 21px;
}

.whats-new-prev {
    left: 12px;
}

.whats-new-next {
    right: 12px;
}

/* Hide navigation when there is only one story if JS applies .single-status */
.whats-new-status.single-status .whats-new-nav {
    display: none;
}

/* Dark mode */
[data-bs-theme="dark"] .whats-new-status-launcher {
    border-color: rgba(37, 211, 102, .16);
    background:
        radial-gradient(circle at 100% 0%, rgba(37, 211, 102, .10), transparent 38%),
        linear-gradient(135deg, rgba(37, 211, 102, .075), rgba(67, 97, 238, .05)),
        var(--card-bg);
}

[data-bs-theme="dark"] .whats-new-status-avatar-ring::after {
    background: var(--card-bg);
}

[data-bs-theme="dark"] .whats-new-status-avatar {
    border-color: var(--card-bg);
}

[data-bs-theme="dark"] .whats-new-status-count {
    border-color: var(--card-bg);
}

/* Mobile */
@media (max-width: 767px) {
    .whats-new-status-launcher {
        min-height: 82px;
        padding: 10px 13px;
        border-radius: 19px;
    }

    .whats-new-status-avatar-wrapper {
        width: 61px;
        height: 61px;
        min-width: 61px;
    }

    .whats-new-status-avatar {
        width: 53px;
        height: 53px;
    }

    .whats-new-status-title {
        font-size: 16px;
    }

    .whats-new-status-subtitle {
        font-size: 12px;
    }

    .whats-new-status-arrow {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    #whatsNewModal .modal-dialog {
        width: 100%;
        max-width: none;
        height: 100%;
        margin: 0;
    }

    #whatsNewModal .modal-content {
        height: 100%;
        min-height: 100%;
        border-radius: 0 !important;
    }

    .whats-new-status {
        height: 100dvh;
        min-height: 100dvh;
    }

    .whats-new-modal-header {
        padding: calc(28px + env(safe-area-inset-top)) 14px 20px;
    }

    .whats-new-progress {
        top: calc(10px + env(safe-area-inset-top));
        left: 9px;
        right: 9px;
    }

    .whats-new-text {
        padding: 100px 20px calc(28px + env(safe-area-inset-bottom));
    }

    .whats-new-text h4 {
        font-size: 21px;
    }

    .whats-new-text p {
        font-size: 14px;
    }

    .whats-new-nav {
        width: 40px;
        height: 40px;
        margin-top: -20px;
    }

    .whats-new-prev {
        left: 8px;
    }

    .whats-new-next {
        right: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .whats-new-status-avatar-ring {
        animation: none;
    }

    .whats-new-status-launcher,
    .whats-new-status-arrow,
    .whats-new-nav {
        transition: none;
    }
}

/* Enhanced Header */
.app-header {
    background: var(--card-bg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

[data-bs-theme="dark"] .app-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 30, 30, 0.95);
}

/* Cards */
.app-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 1rem;
    overflow: hidden;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Buttons */
.btn-app {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-app::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-app:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.3);
    color: white;
}

.btn-app:hover::after {
    left: 100%;
}

.btn-app:active {
    transform: scale(0.95);
}

/* Icon Wrapper */
.icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #e0e7ff, #f3e8ff);
    transition: all 0.3s ease;
}

.app-card:hover .icon-wrapper {
    transform: scale(1.05);
}

[data-bs-theme="dark"] .icon-wrapper {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.2), rgba(114, 9, 183, 0.2));
}

/* Navigation Bottom */
.nav-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 12px 0;
    z-index: 1000;
    max-width: 768px;
    margin: 0 auto;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .nav-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 30, 30, 0.95);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.nav-item {
    text-align: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 0;
}

.nav-item.active {
    color: var(--primary-blue);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-blue), var(--primary-purple));
    border-radius: 3px;
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

/* Countdown Cards */
.countdown-card {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    color: white;
    border-radius: var(--border-radius);
    padding: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.countdown-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1%, transparent 20%);
    animation: pulse 4s linear infinite;
}

@keyframes pulse {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.countdown-number {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Search Bar */
.search-bar {
    background: var(--card-bg);
    border-radius: 50px;
    padding: 16px 28px;
    border: 2px solid transparent;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    background: linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(135deg, var(--primary-blue), var(--primary-purple)) border-box;
}

.search-bar:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.15);
}

/* Horizontal Scroll */
.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 20px;
    padding: 16px 0;
    margin: 0 -16px;
    padding-left: 16px;
    scrollbar-width: none;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.video-card {
    flex: 0 0 auto;
    width: 300px;
    scroll-snap-align: start;
}

/* Progress Circle */
.progress-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(var(--primary-blue) 75%, transparent 0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: rotate 2s linear infinite;
    animation-play-state: paused;
}

.progress-circle:hover {
    animation-play-state: running;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.progress-inner {
    width: 110px;
    height: 110px;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid transparent;
    background: linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(135deg, var(--primary-blue), var(--primary-purple)) border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    cursor: pointer;
}

.theme-toggle:hover {
    transform: rotate(30deg) scale(1.1);
}

/* Dashboard Icons */
.dashboard-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, #e0e7ff, #f3e8ff);
    transition: all 0.3s ease;
}

.app-card:hover .dashboard-icon {
    transform: rotate(5deg) scale(1.1);
}

[data-bs-theme="dark"] .dashboard-icon {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.2), rgba(114, 9, 183, 0.2));
}

/* Footer */
.app-footer {
    background: var(--card-bg);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 40px 0 20px;
    margin-top: 40px;
}

[data-bs-theme="dark"] .app-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 16px;
}

.footer-link::before {
    content: '›';
    position: absolute;
    left: 0;
    opacity: 0;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: var(--primary-blue);
    padding-left: 24px;
    transform: translateX(5px);
}

.footer-link:hover::before {
    opacity: 1;
    left: 8px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes rise {
    from {
        transform: translateY(6px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fall {
    from {
        transform: translateY(-6px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-card {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-up {
    animation: rise 0.4s ease-in-out;
}

.animate-down {
    animation: fall 0.4s ease-in-out;
}

.animate-flat {
    animation: pulse 0.6s ease-in-out;
}

/* Dashboard Specific */
.dashboard-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    color: white;
    padding: 24px 20px;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.stats-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    border-left: 4px solid var(--primary-blue);
}

.rank-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    color: white;
}

/* Progress Components */
.subject-progress {
    position: relative;
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 6px;
    margin-top: 18px;
    overflow: visible;
}

[data-bs-theme="dark"] .subject-progress {
    background: #374151;
}

.progress-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-purple));
}

/* Progress Pin */
.progress-pin {
    position: absolute;
    top: -22px;
    width: 14px;
    height: 14px;
    border-radius: 50% 50% 50% 0;
    transform: translateX(-50%) rotate(-45deg);
    z-index: 9999;
    cursor: pointer;
}

.progress-pin::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
    top: 4px;
    left: 4px;
}

.progress-pin::before {
    content: attr(data-label);
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    background: #111827;
    color: #ffffff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.progress-pin:hover::before,
.progress-pin:active::before {
    opacity: 1;
}

[data-bs-theme="dark"] .progress-pin::before {
    background: #f9fafb;
    color: #111827;
}

.pin-min {
    background: #dc3545;
}

.pin-avg {
    background: #ffc107;
    box-shadow: 0 0 0 2px #ffffff;
}

.pin-max {
    background: #198754;
}

/* Topper Cards */
.topper-card {
    flex-shrink: 0;
    width: 40%;
}

@media (max-width: 767px) {
    .topper-card {
        width: 50%;
    }
}

/* Page Transitions */
.page-transition {
    animation: fadeInUp 0.4s ease;
}

/* Breadcrumb */
.breadcrumb-wrap {
    background-color: white;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.breadcrumb {
    background-color: transparent;
    padding: 0;
}

.breadcrumb-item+.breadcrumb-item::before {
    content: "›";
    color: #6c757d;
    padding: 0 8px;
}

[data-bs-theme="dark"] .breadcrumb-wrap {
    background-color: #1e293b;
    border-bottom-color: #334155;
}

[data-bs-theme="dark"] .breadcrumb a {
    color: #c7d2fe;
}

[data-bs-theme="dark"] .breadcrumb-item.active {
    color: #e5e7eb;
}

/* Content Cards */
.content-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    height: 100%;
    position: relative;
    transition: transform 0.2s ease;
}

.content-card:hover {
    transform: translateY(-2px);
}

.card-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.folder .card-icon {
    color: #ffc107;
}

.pdf .card-icon {
    color: #dc3545;
}

.video .card-icon {
    color: #4361ee;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.card-meta {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 0;
}

.card-actions {
    position: absolute;
    top: 16px;
    right: 16px;
}

.btn-action {
    background: none;
    border: none;
    color: #6c757d;
    padding: 4px;
}

/* Stat Card White */
.stat-card-white {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: all .3s ease;
}

.stat-card-white:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

.icon-box {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4f46e5;
    font-size: 26px;
}

.stat-card-white h2 {
    color: #111827;
}

.stat-card-white p {
    font-size: 15px;
}

[data-bs-theme="dark"] .stat-card-white {
    background: #1f2937;
    border-color: #6366f1;
}

[data-bs-theme="dark"] .stat-card-white h2 {
    color: #f9fafb;
}

[data-bs-theme="dark"] .stat-card-white p {
    color: #d1d5db;
}

/* Utility Classes */
.subject-hover {
    cursor: pointer;
}

.subject-hover:hover {
    text-decoration: underline;
    color: var(--bs-primary);
}

.subject-trigger {
    cursor: pointer;
}

.subject-trigger:hover {
    color: var(--bs-primary);
    text-decoration: underline;
}

/* Security Toggle Box */
.security-header {
    cursor: pointer;
}

.security-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease;
    opacity: 0;
}

.security-box.open .security-content {
    max-height: 600px;
    opacity: 1;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.security-box.open .toggle-icon {
    transform: rotate(180deg);
}

/* Message Overlay */
.message-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.message-alert {
    max-width: 420px;
    width: calc(100% - 32px);
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 260px;
    height: 100%;
    background: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    transition: 0.3s;
    z-index: 9999;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-content {
    padding: 25px;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 0;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    font-weight: 500;
}

.menu-link:hover {
    color: var(--primary-blue);
}

/* Utility Classes */
.transition-hover {
    transition: all 0.2s ease-in-out;
}

.transition-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08) !important;
    border-color: #dee2e6 !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
}

.bg-opacity-10 {
    --bs-bg-opacity: 0.1;
}

.bg-opacity-15 {
    --bs-bg-opacity: 0.15;
}

.tracking-wide {
    letter-spacing: 0.5px;
}

.rounded-4 {
    border-radius: 1rem !important;
}

/* =========================================================
   PDF ANNOTATION / VIEWER
========================================================= */

.transition {
    transition: all 0.3s ease;
}

.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* =========================================================
   PDF WRAPPER
   IMPORTANT: No fixed height. The wrapper must grow with
   all rendered PDF pages on mobile, tablet and desktop.
========================================================= */
#pdf-wrapper {
    position: relative;
    width: 100%;
    min-height: 500px;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    background: transparent;
    -webkit-overflow-scrolling: touch;
}

/* =========================================================
   PDF LOADING INDICATOR
========================================================= */
#loadingIndicator {
    position: absolute;
    inset: 0;
    width: 100%;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #ffffff;
    z-index: 1000;
}

#loadingIndicator .spinner-border {
    width: 3rem;
    height: 3rem;
}

#loadingIndicator .loading-text {
    margin-top: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
}

#loadingIndicator .loading-subtext {
    margin-top: 5px;
    font-size: 13px;
    color: #6c757d;
}

/* =========================================================
   PDF FLOW CONTAINER
========================================================= */
#pdf-flow-container {
    position: relative;
    width: 100%;
    display: block;
    overflow: visible;
    min-height: 0;
    height: auto;
}

/* =========================================================
   PDF ZOOM STAGE
========================================================= */
#pdf-zoom-stage {
    position: relative;
    width: 100%;
    min-height: 0;
    transform-origin: top center;
    will-change: transform;
}

/* =========================================================
   PDF CONTAINER
========================================================= */
#pdf-container {
    width: 100%;
    max-width: 100%;
    display: block;
    min-height: 0;
}

/* =========================================================
   PDF PAGE WRAPPER
========================================================= */
.pdf-page-wrapper {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 24px;
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
    border-radius: 4px;
    overflow: hidden;
    touch-action: pan-y;
}

.pdf-page-wrapper canvas.pdf-render-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* =========================================================
   DRAWING CANVAS
========================================================= */
.draw-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    cursor: crosshair;
}

.pdf-page-wrapper .draw-canvas {
    border-radius: 4px;
}

.draw-canvas:active {
    cursor: none;
}

.draw-canvas.drawing-active {
    touch-action: none;
}

.draw-mode-active .draw-canvas {
    pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
    .draw-canvas {
        cursor: crosshair;
    }
}

/* =========================================================
   PDF SCROLLBAR
========================================================= */
#pdf-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#pdf-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#pdf-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#pdf-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* =========================================================
   BUTTON STATES
========================================================= */
.btn-primary.active {
    background-color: #0d6efd;
    color: white;
}

.btn-warning.active {
    background-color: #ffc107;
    color: black;
}

/* =========================================================
   LOADING SPINNER
========================================================= */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* =========================================================
   BADGE STYLES
========================================================= */
.badge {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.badge:hover {
    opacity: 0.9;
}

/* =========================================================
   CURSOR STYLES
========================================================= */
.cursor-pen {
    cursor: crosshair !important;
}

.cursor-eraser {
    cursor: cell !important;
}

.cursor-highlight {
    cursor: text !important;
}

/* =========================================================
   PAGE NAVIGATION
========================================================= */
.page-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.page-nav-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.page-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.page-nav-left {
    left: 10px;
}

.page-nav-right {
    right: 10px;
}

.page-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 1000;
    backdrop-filter: blur(5px);
    font-weight: 500;
    pointer-events: none;
}

/* =========================================================
   ZOOM CONTAINER
========================================================= */
.zoom-container {
    transform-origin: 0 0;
    will-change: transform;
}

/* =========================================================
   MOBILE PDF SETTINGS
========================================================= */
@media (max-width: 768px) {

    .btn-group .btn {
        padding: 0.375rem 0.5rem;
    }

    .btn-group .btn i {
        font-size: 1rem;
    }

    .form-range {
        width: 70px;
    }

    /* Never use a fixed 55vh height for the PDF. */
    #pdf-wrapper {
        width: 100%;
        height: auto !important;
        min-height: 55vh;
        max-height: none !important;
        overflow: visible !important;
    }

    #pdf-flow-container {
        height: auto !important;
        min-height: 0;
        overflow: visible !important;
    }

    #pdf-zoom-stage {
        width: 100%;
        height: auto;
        min-height: 0;
    }

    #pdf-container {
        width: 100%;
        height: auto;
        min-height: 0;
    }

    #loadingIndicator {
        min-height: 55vh;
        height: 100%;
    }

    .pdf-page-wrapper {
        width: fit-content;
        max-width: 100%;
        margin: 8px auto 16px;
        box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
    }

    .pdf-page-wrapper canvas.pdf-render-canvas {
        max-width: 100%;
        height: auto;
    }

    .floating-write-btn {
        width: 55px;
        height: 55px;
        bottom: 20px;
        right: 20px;
    }

    .floating-write-btn i {
        font-size: 26px;
    }
}

/* =========================================================
   SMALL MOBILE DEVICES
========================================================= */
@media (max-width: 480px) {

    #pdf-wrapper {
        min-height: 50vh;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    #loadingIndicator {
        min-height: 50vh;
    }

    .pdf-page-wrapper {
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 14px;
    }
}

/* =========================================================
   TABLET
========================================================= */
@media (min-width: 769px) and (max-width: 1024px) {

    #pdf-wrapper {
        height: auto !important;
        min-height: 500px;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* =========================================================
   DESKTOP
========================================================= */
@media (min-width: 1025px) {

    #pdf-wrapper {
        height: auto !important;
        min-height: 500px;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* Floating Write Button */
.floating-write-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: floatPulse 2s infinite ease-in-out;
}

.floating-write-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.floating-write-btn:active {
    transform: scale(0.95);
}

.floating-write-btn i {
    font-size: 32px;
    color: white;
    transition: transform 0.2s;
}

.floating-write-btn.active {
    background: linear-gradient(135deg, #00b4db 0%, #0083b0 100%);
    box-shadow: 0 0 20px rgba(0, 180, 219, 0.6);
}

.floating-write-btn.active i {
    transform: rotate(15deg);
}

.floating-write-btn::before {
    content: "Tap to write";
    position: absolute;
    bottom: 80px;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    pointer-events: none;
}

.floating-write-btn:hover::before {
    opacity: 1;
    visibility: visible;
    bottom: 85px;
}

@keyframes floatPulse {
    0% {
        transform: translateY(0px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    }

    50% {
        transform: translateY(-5px);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    }

    100% {
        transform: translateY(0px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    }
}

/* Toolbar Buttons */
.toolbar-btn {
    min-height: 44px;
    min-width: 44px;
    pointer-events: auto !important;
    z-index: 100 !important;
}

.btn-group button,
.btn-group .btn {
    pointer-events: auto !important;
    z-index: 100 !important;
}

/* Camera Drag */
#cameraBox {
    transition: none !important;
}

/* iOS Safari Safe Fix */
#learningResource .col-6 {
    display: flex;
}

#learningResource .col-6>a {
    width: 100%;
}

#learningResource .app-card {
    min-height: 100%;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-tap-highlight-color: transparent;
}

#learningResource .app-card:hover {
    box-shadow: var(--shadow-md);
}

#learningResource .icon-wrapper {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    #learningResource .app-card {
        padding: 1rem !important;
    }
}

/* Game Thumbnails */
.game-thumb {
    width: 100%;
    height: 220px;
    object-fit: cover;
    object-position: center;
    border-radius: 16px;
    display: block;
    background: #f8f9fa;
}

.game-card {
    display: flex;
    flex-direction: column;
}

.game-card .btn {
    margin-top: auto;
}

@media (max-width: 768px) {
    .game-thumb {
        height: 180px;
    }
}

/* PHP/HTML Content */
.php-content-wrapper {
    position: relative;
    min-height: 500px;
}

.php-content {
    position: relative;
    z-index: 1;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.php-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
}

.php-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #2c2c2c;
}

.php-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #3a3a3a;
}

.php-content p {
    line-height: 1.8;
    margin-bottom: 1rem;
    color: #4a4a4a;
}

.php-content ul, .php-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.php-content li {
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.php-content table {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
}

.php-content th, .php-content td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.php-content th {
    background-color: #f5f5f5;
    font-weight: 600;
}

@media (max-width: 768px) {
    .php-content {
        padding: 1rem;
    }

    .php-content h1 {
        font-size: 1.5rem;
    }

    .php-content h2 {
        font-size: 1.25rem;
    }
}

/* FAQ Section */
.faq-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid #e0e0e0;
}

.faq-item {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.faq-question {
    font-weight: 700;
    color: #007bff;
    margin-bottom: 0.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question:hover {
    color: #0056b3;
}

.faq-answer {
    color: #666;
    line-height: 1.6;
    display: none;
}

.faq-answer.active {
    display: block;
}

.faq-toggle {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.faq-toggle.rotated {
    transform: rotate(180deg);
}

/* Annotation Overlay */
.php-annotation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    z-index: 2;
}

.php-content-container {
    position: relative;
}

/* Sticky Notes */
.sticky-note {
    position: absolute;
    background: #fff9c4;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    max-width: 300px;
    z-index: 100;
    cursor: move;
    border-left: 4px solid #ffc107;
}

.sticky-note textarea {
    width: 100%;
    border: none;
    background: transparent;
    resize: vertical;
    font-size: 14px;
    line-height: 1.5;
}

.sticky-note textarea:focus {
    outline: none;
}

.sticky-note-close {
    position: absolute;
    top: 5px;
    right: 8px;
    cursor: pointer;
    color: #999;
    font-size: 18px;
}

.sticky-note-close:hover {
    color: #333;
}

@media (max-width: 768px) {
    .sticky-note {
        min-width: 150px;
        max-width: 250px;
    }
}

/* Related Topics */
.related-topics {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.related-topics h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.related-topic-link {
    display: inline-block;
    margin: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 20px;
    text-decoration: none;
    color: #007bff;
    transition: all 0.3s;
}

.related-topic-link:hover {
    background: #007bff;
    color: white;
    transform: translateY(-2px);
}

/* Quick Answer */
.quick-answer {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: 8px;
}

.quick-answer h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: #1976d2;
}

/* File Cards */
.file-card {
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.file-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.file-card .common-icon {
    font-size: 3rem;
    color: #6c757d;
    transition: all 0.3s ease;
}

.file-card:hover .common-icon {
    color: #007bff;
    transform: scale(1.1);
}

.common-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    background: #e9ecef;
    color: #6c757d;
    font-weight: 500;
}

/* Loading States */
body.zooming-active {
    overflow: hidden;
}

.zooming-active #pdf-wrapper {
    overflow: hidden;
}

/* Floating Toolbar Styles */
.floating-toolbar {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: #1e1e2f;
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 8px 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.floating-toolbar.visible {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

.toolbar-handle {
    cursor: grab;
    padding: 8px 4px;
    color: #aaa;
    font-size: 18px;
    transition: color 0.2s;
}

.toolbar-handle:active {
    cursor: grabbing;
}

.toolbar-handle:hover {
    color: #fff;
}

.toolbar-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tool-button {
    background: transparent;
    border: none;
    color: #ccc;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
}

.tool-button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.tool-button.active-tool {
    background: #007bff;
    color: #fff;
}

.tool-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 4px;
}

.tool-color-wrapper {
    background: #2a2a3a;
    border-radius: 12px;
    padding: 4px;
}

.tool-color-picker {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

.tool-size-wrapper {
    background: #2a2a3a;
    border-radius: 12px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-size-slider {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    background: #444;
    border-radius: 2px;
}

.tool-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
}

.tool-size-value {
    color: #fff;
    font-size: 11px;
    min-width: 20px;
    text-align: center;
}

/* Floating write button */
.floating-write-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background: linear-gradient(135deg, #007bff, #6610f2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    z-index: 9999;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-write-btn:hover {
    transform: scale(1.05);
}

.floating-write-btn.active {
    background: linear-gradient(135deg, #28a745, #20c997);
}

/* Responsive: Collapse toolbar on small screens */
@media (max-width: 768px) {

    .floating-toolbar {
        padding: 6px 10px;
        gap: 4px;
        max-width: calc(100% - 40px);
        overflow-x: auto;
    }

    .tool-button {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .tool-size-slider {
        width: 50px;
    }

    .toolbar-buttons {
        gap: 4px;
    }

}

.study-material-img {
    display: block;
    margin: 20px auto;
    max-width: 500px;
    width: 100%;
    height: auto;
    max-height: 800px;
    object-fit: contain;
}

/* =========================================================
   LECTURE HOME - APP PACKAGES / PRICING MODAL
   Bootstrap 5 Compatible
   Scoped only to #pricingModal
========================================================= */

/* ---------------------------------------------------------
   MODAL
--------------------------------------------------------- */
#pricingModal .modal-dialog {
    width: 95%;
    max-width: 1200px;
    margin: 1.25rem auto
}

#pricingModal .modal-content {
    border: 0;
    border-radius: 22px;
    overflow: hidden;
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .15)
}

/* ---------------------------------------------------------
   HEADER
--------------------------------------------------------- */
#pricingModal .pricing-header {
    padding: 28px 25px;
    color: #fff;
    background: linear-gradient(135deg, #0d6efd, #084298)
}

#pricingModal .pricing-header h4 {
    margin: 0 0 6px;
    color: #fff;
    font-weight: 700;
    line-height: 1.3
}

#pricingModal .pricing-header p {
    margin: 0;
    color: rgba(255, 255, 255, .9)
}

/* ---------------------------------------------------------
   MODAL BODY
--------------------------------------------------------- */
#pricingModal .modal-body {
    padding: 28px;
    background: var(--card-bg)
}

/* ---------------------------------------------------------
   MONTHLY / YEARLY TOGGLE
--------------------------------------------------------- */
#pricingModal .pricing-toggle {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px;
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 50px
}

#pricingModal .pricing-toggle button {
    border: 0;
    outline: 0;
    padding: 8px 20px;
    border-radius: 50px;
    background: transparent;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease
}

#pricingModal .pricing-toggle button:hover {
    color: #0d6efd
}

#pricingModal .pricing-toggle button.active {
    background: #0d6efd;
    color: #fff;
    box-shadow: 0 3px 10px rgba(13, 110, 253, .25)
}

/* ---------------------------------------------------------
   PRICING GRID
--------------------------------------------------------- */
#pricingModal .pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch
}

/* ---------------------------------------------------------
   PRICING CARD
--------------------------------------------------------- */
#pricingModal .pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 100%;
    padding: 22px;
    background: #fff;
    color: #212529;
    border: 1px solid #e9ecef;
    border-radius: 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .04);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease
}

#pricingModal .pricing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .08)
}

#pricingModal .pricing-card.popular {
    border: 2px solid #0d6efd
}

/* ---------------------------------------------------------
   POPULAR BADGE
--------------------------------------------------------- */
#pricingModal .popular-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 50px;
    background: #0d6efd;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap
}

/* ---------------------------------------------------------
   PACKAGE NAME
--------------------------------------------------------- */
#pricingModal .pricing-name {
    margin: 0 0 8px;
    padding-right: 90px;
    color: #212529;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3
}

/* ---------------------------------------------------------
   PACKAGE DESCRIPTION
--------------------------------------------------------- */
#pricingModal .pricing-description {
    min-height: 42px;
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5
}

/* ---------------------------------------------------------
   PRICE
--------------------------------------------------------- */
#pricingModal .pricing-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 5px;
    margin: 18px 0
}

#pricingModal .pricing-price .amount {
    color: #0d6efd;
    font-size: 34px;
    font-weight: 800;
    line-height: 1
}

#pricingModal .pricing-price .period {
    color: #6c757d;
    font-size: 14px
}

/* ---------------------------------------------------------
   YEARLY SAVING
--------------------------------------------------------- */
#pricingModal .yearly-saving {
    display: inline-block;
    margin-left: 5px;
    padding: 3px 8px;
    border-radius: 20px;
    background: #e8f5e9;
    color: #198754;
    font-size: 11px;
    font-weight: 700
}

/* ---------------------------------------------------------
   FEATURES
--------------------------------------------------------- */
#pricingModal .pricing-features {
    flex-grow: 1;
    margin: 20px 0;
    padding: 0;
    list-style: none
}

#pricingModal .pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 0;
    color: #343a40;
    font-size: 14px;
    line-height: 1.4
}

#pricingModal .pricing-features li i {
    flex-shrink: 0;
    margin-top: 2px;
    color: #198754
}

#pricingModal .pricing-features li.disabled {
    color: #adb5bd
}

#pricingModal .pricing-features li.disabled i {
    color: #adb5bd
}

/* ---------------------------------------------------------
   NOTE
--------------------------------------------------------- */
#pricingModal .pricing-note {
    margin-top: 10px;
    color: #6c757d;
    font-size: 12px;
    line-height: 1.5
}

/* ---------------------------------------------------------
   CARD BUTTON
--------------------------------------------------------- */
#pricingModal .pricing-card .btn {
    width: 100%;
    margin-top: auto;
    padding: 9px 12px;
    border-radius: 9px;
    font-weight: 600
}

/* ---------------------------------------------------------
   PAPER PILOT
--------------------------------------------------------- */
#pricingModal .paper-pilot-box {
    padding: 22px;
    background: #f8f9fa;
    color: #212529;
    border: 1px solid #dee2e6;
    border-radius: 18px
}

#pricingModal .paper-pilot-box h5 {
    margin-bottom: 10px;
    color: #212529;
    font-weight: 700
}

#pricingModal .paper-subject {
    height: 100%;
    padding: 14px;
    background: #fff;
    color: #212529;
    border: 1px solid #dee2e6;
    border-radius: 12px
}

#pricingModal .paper-subject .price {
    color: #0d6efd;
    font-size: 20px;
    font-weight: 700
}

/* ---------------------------------------------------------
   FOOTER
--------------------------------------------------------- */
#pricingModal .pricing-footer {
    padding: 18px 25px;
    background: #f8f9fa;
    color: #6c757d;
    border-top: 1px solid #dee2e6;
    text-align: center;
    font-size: 13px
}

/* =========================================================
   DARK MODE
========================================================= */
[data-bs-theme="dark"] #pricingModal .modal-content {
    background: #1e1e1e;
    color: #f8f9fa;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .45)
}

[data-bs-theme="dark"] #pricingModal .modal-body {
    background: #1e1e1e
}

[data-bs-theme="dark"] #pricingModal .pricing-toggle {
    background: #2b3035;
    border-color: #495057
}

[data-bs-theme="dark"] #pricingModal .pricing-toggle button {
    color: #adb5bd
}

[data-bs-theme="dark"] #pricingModal .pricing-toggle button:hover {
    color: #fff
}

[data-bs-theme="dark"] #pricingModal .pricing-toggle button.active {
    background: #0d6efd;
    color: #fff
}

[data-bs-theme="dark"] #pricingModal .pricing-card {
    background: #252525;
    color: #f8f9fa;
    border-color: #3b3b3b;
    box-shadow: none
}

[data-bs-theme="dark"] #pricingModal .pricing-card:hover {
    background: #292929;
    border-color: #0d6efd;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35)
}

[data-bs-theme="dark"] #pricingModal .pricing-card.popular {
    border-color: #0d6efd
}

[data-bs-theme="dark"] #pricingModal .pricing-name {
    color: #f8f9fa
}

[data-bs-theme="dark"] #pricingModal .pricing-description {
    color: #adb5bd
}

[data-bs-theme="dark"] #pricingModal .pricing-price .amount {
    color: #6ea8fe
}

[data-bs-theme="dark"] #pricingModal .pricing-price .period {
    color: #adb5bd
}

[data-bs-theme="dark"] #pricingModal .yearly-saving {
    background: rgba(25, 135, 84, .18);
    color: #75d6a1
}

[data-bs-theme="dark"] #pricingModal .pricing-features li {
    color: #dee2e6
}

[data-bs-theme="dark"] #pricingModal .pricing-features li.disabled {
    color: #6c757d
}

[data-bs-theme="dark"] #pricingModal .pricing-features li.disabled i {
    color: #6c757d
}

[data-bs-theme="dark"] #pricingModal .pricing-note {
    color: #adb5bd
}

[data-bs-theme="dark"] #pricingModal .paper-pilot-box {
    background: #252525;
    color: #f8f9fa;
    border-color: #3b3b3b
}

[data-bs-theme="dark"] #pricingModal .paper-pilot-box h5 {
    color: #f8f9fa
}

[data-bs-theme="dark"] #pricingModal .paper-subject {
    background: #1e1e1e;
    color: #f8f9fa;
    border-color: #3b3b3b
}

[data-bs-theme="dark"] #pricingModal .paper-subject .price {
    color: #6ea8fe
}

[data-bs-theme="dark"] #pricingModal .pricing-footer {
    background: #181818;
    color: #adb5bd;
    border-top-color: #3b3b3b
}

/* =========================================================
   LARGE DESKTOP
========================================================= */
@media (min-width:1200px) {
    #pricingModal .modal-dialog {
        max-width: 1200px
    }
}

/* =========================================================
   TABLET
========================================================= */
@media (min-width:768px) and (max-width:1199.98px) {
    #pricingModal .modal-dialog {
        width: 95%;
        max-width: 900px
    }

    #pricingModal .pricing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

/* =========================================================
   MOBILE
========================================================= */
@media (max-width:767.98px) {
    #pricingModal .modal-dialog {
        width: auto;
        max-width: none;
        margin: 10px
    }

    #pricingModal .modal-body {
        padding: 20px 16px
    }

    #pricingModal .pricing-header {
        padding: 22px 18px
    }

    #pricingModal .pricing-grid {
        grid-template-columns: 1fr;
        gap: 16px
    }

    #pricingModal .pricing-card {
        padding: 20px
    }

    #pricingModal .pricing-name {
        padding-right: 75px
    }

    #pricingModal .pricing-price .amount {
        font-size: 30px
    }

    #pricingModal .pricing-toggle button {
        padding: 8px 16px
    }

    #pricingModal .pricing-footer {
        padding: 16px 18px
    }
}

/* =========================================================
   SMALL MOBILE
========================================================= */
@media (max-width:420px) {
    #pricingModal .modal-dialog {
        margin: 8px
    }

    #pricingModal .modal-body {
        padding: 18px 12px
    }

    #pricingModal .pricing-card {
        padding: 18px;
        border-radius: 16px
    }

    #pricingModal .pricing-name {
        padding-right: 65px;
        font-size: 18px
    }

    #pricingModal .pricing-price .amount {
        font-size: 28px
    }

    #pricingModal .pricing-toggle button {
        padding: 7px 13px;
        font-size: 13px
    }

    #pricingModal .popular-badge {
        top: 12px;
        right: 12px;
        font-size: 9px
    }
}