body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #fafafa;
    overflow-x: hidden;
    user-select: none;
}

/* WATERMARK */
#wmOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255,255,255,0.05) 0px,
        rgba(255,255,255,0.05) 70px,
        rgba(0,0,0,0.04) 70px,
        rgba(0,0,0,0.04) 140px
    );
}
#wmOverlay::after {
    content: "Dr. Kedar Bakshi • Osseosure";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%) rotate(-30deg);
    font-size: 48px;
    opacity: 0.14;
    color: white;
    font-weight: bold;
}

/* PAGE TITLE */
.page-title {
    font-size: 32px;
    font-weight: bold;
    margin: 25px 0 10px 30px;
}

/* FILTER BAR */
.filter-bar {
    display: flex;
    gap: 10px;
    padding: 0 30px 20px;
    flex-wrap: wrap;
}
.filter-chip {
    padding: 6px 14px;
    border-radius: 20px;
    background: #eaeaea;
    cursor: pointer;
}
.filter-active {
    background: #ffd400;
    font-weight: bold;
}

/* HEADER */
.case-header {
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.case-title {
    font-size: 26px;
    font-weight: bold;
}
.case-meta {
    color: #666;
    margin-top: 5px;
}
.nav-buttons span {
    cursor: pointer;
    margin: 0 10px;
    color: #444;
}

/* MAIN LAYOUT */
.columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 25px;
    padding: 0 30px;
}
.box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
}
.box-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}
.case-img {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
}

/* TECHNIQUE */
.tech-main {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
}
.tech-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}
.tech-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
}
.tech-thumb-active {
    border-color: #ffd400;
}
.tech-title {
    margin-top: 12px;
    font-weight: bold;
}
.tech-desc {
    margin-top: 6px;
    color: #444;
}

/* STEP NAV */
.step-nav {
    margin-top: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.step-nav button {
    padding: 6px 14px;
    border-radius: 16px;
    border: none;
    background: #ececec;
    cursor: pointer;
}

/* GRID OF CASES BELOW */
.case-grid {
    margin: 40px 30px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.case-card {
    width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    cursor: pointer;
}
.case-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}
.case-card-title {
    padding: 10px;
    font-weight: bold;
}
/* Improved Split Thumbnail Without Distortion */
.case-card-thumb {
    width: 100%;
    height: 150px;
    border-radius: 14px;
    position: relative;
    overflow: hidden;

    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* left: BEFORE */
.case-card-thumb .thumb-before,
.case-card-thumb .thumb-after {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* White divider */
.case-card-thumb::after {
    content: "";
    position: absolute;
    top: 0;
    left: calc(50% - 1.5px);
    width: 3px;
    height: 100%;
    background: rgba(255,255,255,0.85);
    z-index: 10;
}


/* Popup Overlay FIXED */
#popupOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: none;            /* HIDDEN BY DEFAULT */
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Ensures 'hidden' works */
.hidden {
    display: none !important;
}

/* Popup body */
#popupBody {
    max-width: 90%;
    max-height: 90%;
}

/* Close button */
#popupClose {
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 30px;
    color: white;
    z-index: 10000;
    cursor: pointer;
}

/* Prevent overlay from blocking page when closed */
#popupOverlay.hidden {
    display: none !important;
}
/* Popup image wrapper */
.popup-img-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100%;
}

/* Image inside popup */
.popup-img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

/* Watermark inside popup */
.popup-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 48px;
    color: white;
    font-weight: bold;
    opacity: 0.15;
    pointer-events: none;
    white-space: nowrap;
}
.popup-video-wrapper {
    position: relative;
    width: 90vw;
    max-width: 900px;
}

.popup-video {
    width: 100%;
    height: 500px;
    border-radius: 12px;
}

.popup-video-watermark {
    position: absolute;
    bottom: 10px;
    right: 10px;
    opacity: 0.25;
    color: white;
    font-weight: bold;
    pointer-events: none;
}

/* ========================================================
   v6.2 ADDITIONS — Videos filter, play badge, no-results
   ======================================================== */

/* Videos filter chip — inactive state matches other chips */
.filter-chip.filter-video-chip {
    font-weight: bold;
}
/* Active state: yellow, same as other active filter chips */
.filter-chip.filter-video-chip.filter-active {
    background: #ffd400;
    color: #1a1a1a;
    font-weight: bold;
}

/* Play icon badge on thumbnail of any case that contains a video */
.case-card-thumb {
    position: relative; /* ensure badge positions correctly */
}
.video-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffd400;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    padding-left: 2px; /* optical alignment for ▶ glyph */
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    z-index: 20;
    pointer-events: none;
    font-weight: bold;
}

/* Message when filter returns no cases */
.no-results {
    width: 100%;
    padding: 40px 20px;
    text-align: center;
    color: #888;
    font-style: italic;
    background: #f5f5f5;
    border-radius: 12px;
}

/* ========================================================
   PAGINATION CONTROLS (below the case grid)
   ======================================================== */
.case-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 30px 30px 50px;
    flex-wrap: wrap;
}
.pag-nav {
    padding: 8px 18px;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}
.pag-nav:hover:not(:disabled) {
    background: #ffd400;
    border-color: #ffd400;
    color: #1a1a1a;
}
.pag-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.pag-dots {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
.page-dot {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: white;
    color: #333;
    border: 1px solid #d8d8d8;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}
.page-dot:hover {
    border-color: #ffd400;
}
.page-dot.active {
    background: #ffd400;
    border-color: #ffd400;
    color: #1a1a1a;
}

/* Mobile: smaller pagination controls */
@media (max-width: 640px) {
    .case-pagination {
        margin: 20px 15px 40px;
        gap: 8px;
    }
    .pag-nav {
        padding: 6px 12px;
        font-size: 13px;
    }
    .page-dot {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }
}

