/* Case Gallery — shared styles for admin + public pages */
.case-card {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
    cursor: pointer;
}
.case-card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.case-card-selected {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}
.case-card-check {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    padding: 4px;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    pointer-events: none;
}
.case-card-check .form-check-input {
    width: 22px;
    height: 22px;
    margin: 0;
    cursor: pointer;
}
.case-card-featured {
    border-color: #f0b429;
    box-shadow: 0 4px 14px rgba(240, 180, 41, 0.25);
}
.case-card-featured:hover {
    box-shadow: 0 8px 22px rgba(240, 180, 41, 0.35);
}
.case-card-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #f0b429 0%, #de8b0e 100%);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.3rem 0.9rem;
    border-bottom-left-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 2;
    pointer-events: none;
}
.case-card-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #f8f9fa;
    aspect-ratio: 2 / 1;
    overflow: hidden;
}
.case-card-single {
    background: #f8f9fa;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.case-card-pair img,
.case-card-single img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.case-card-pair .placeholder,
.case-card-single .placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 2rem;
    width: 100%;
    height: 100%;
}
.case-card-body { padding: 0.75rem 1rem; }
.case-card-title { font-weight: 600; font-size: 1rem; margin-bottom: 0.25rem; }
.case-card-meta { font-size: 0.85rem; color: #6c757d; }

.status-pill {
    font-size: 0.7rem;
    padding: 0.2em 0.6em;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.status-draft { background: #6c757d; color: white; }
.status-pending_doctor { background: #ffc107; color: #333; }
.status-approved { background: #28a745; color: white; }
.status-archived { background: #343a40; color: white; opacity: 0.7; }

.photo-cell {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
}
.photo-cell img { width: 100%; height: 140px; object-fit: cover; display: block; }
.photo-cell .role-tag {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.1em 0.5em;
    border-radius: 4px;
    text-transform: capitalize;
}
.photo-cell .btn-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(220, 53, 69, 0.85);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
    line-height: 28px;
    padding: 0;
    cursor: pointer;
    touch-action: manipulation;
}
.photo-cell .role-tag {
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
}
.photo-cell .role-tag:hover { background: rgba(13, 110, 253, 0.85); }
.photo-cell .role-tag:active { background: rgba(13, 110, 253, 1); }

.photo-dropzone {
    border: 2px dashed #adb5bd;
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    background: #f8f9fa;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.15s;
    touch-action: manipulation;
}
.photo-dropzone:hover, .photo-dropzone:active {
    border-color: #0d6efd;
    background: #e7f1ff;
    color: #0d6efd;
}
.photo-dropzone.dragover {
    border-color: #0d6efd;
    background: #cfe2ff;
    color: #0d6efd;
    transform: scale(1.01);
}
.photo-dropzone .dropzone-prompt { pointer-events: none; }

.photo-cell.uploading { opacity: 0.5; }
.photo-cell.uploading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.4) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'><circle cx='25' cy='25' r='20' fill='none' stroke='%230d6efd' stroke-width='4' stroke-linecap='round' stroke-dasharray='31.4 31.4'><animateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='1s' repeatCount='indefinite'/></circle></svg>") center/40px no-repeat;
}

.public-hero {
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
    color: #fff;
    padding: 3rem 1rem;
    text-align: center;
    border-radius: 0 0 24px 24px;
    margin-bottom: 2rem;
}
.public-before-after {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}
.public-before-after figure { margin: 0; }
.public-before-after img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.public-before-after figcaption {
    text-align: center;
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.consent-footer {
    font-size: 0.8rem;
    color: #6c757d;
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
    margin-top: 2rem;
}

/* Single 2:1 image that already contains the before and after side by side
   (role="combined" — every scraped beautifulsmiles case). Full width rather
   than squeezed into one half of the before/after grid. */
.public-combined {
    margin: 0 0 2rem;
}
.public-combined img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.public-combined figcaption {
    text-align: center;
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.35rem;
}

/* ---- Case detail slider ----------------------------------------------
   Source images are only ~505px wide. Stretching one across a 1300px
   container is what made the case page look blurry and unfinished, so the
   slider is capped near the images' native width and centred. */
.case-slider {
    max-width: 760px;
    margin: 0 auto 1.5rem;
}
.case-slider .carousel-inner {
    border-radius: 10px;
    background: #f8f9fa;
    box-shadow: 0 2px 10px rgba(0,0,0,0.10);
}
.case-slide-img {
    width: 100%;
    display: block;
    cursor: zoom-in;
}
.case-slide-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    text-align: center;
}
/* Default control icons vanish against the pale clinical photos. */
.case-slider .carousel-control-prev,
.case-slider .carousel-control-next {
    width: 12%;
    opacity: 1;
}
.case-slider .carousel-control-prev-icon,
.case-slider .carousel-control-next-icon {
    background-color: rgba(0,0,0,0.55);
    border-radius: 50%;
    padding: 1.1rem;
    background-size: 45% 45%;
}
.case-slider .carousel-control-prev:hover .carousel-control-prev-icon,
.case-slider .carousel-control-next:hover .carousel-control-next-icon {
    background-color: rgba(13, 110, 253, 0.85);
}
.case-slide-hint {
    text-align: center;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.6rem;
}
.case-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
}
.case-thumb {
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 0;
    background: none;
    overflow: hidden;
    line-height: 0;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s, border-color 0.15s;
}
.case-thumb img { width: 92px; height: 46px; object-fit: cover; display: block; }
.case-thumb:hover { opacity: 1; }
.case-thumb.active { opacity: 1; border-color: #0d6efd; }

.case-narrative {
    max-width: 760px;
    margin: 0 auto;
    line-height: 1.7;
}

@media (max-width: 575.98px) {
    .case-slider .carousel-control-prev,
    .case-slider .carousel-control-next { width: 20%; }
    .case-thumb img { width: 72px; height: 36px; }
}
