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;
}
