/* =====================================================================
   میز پرونده‌های سه‌بعدی — استایل صحنه و پنل مطالعه
   ===================================================================== */

.cases3d-section {
    padding-top: 26px;
    padding-bottom: 10px;
}

.cases3d-stage {
    position: relative;
    height: 620px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 50% -10%, #2c3e6b 0%, #1b2a4a 45%, #0f1a30 100%);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(201, 168, 76, 0.25);
}

.cases3d-stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: pan-y; /* اسکرول عمودی صفحه روی موبایل قفل نشود */
}

/* راهنمای کاربر */
.cases3d-hint {
    position: absolute;
    top: 18px;
    right: 50%;
    transform: translateX(50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 26, 48, 0.75);
    color: #f2e9d4;
    border: 1px solid rgba(201, 168, 76, 0.45);
    backdrop-filter: blur(6px);
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
    z-index: 2;
    animation: cases3d-pulse 2.6s ease-in-out infinite;
}

.cases3d-hint.is-hidden {
    opacity: 0;
    transform: translateX(50%) translateY(-8px);
    animation: none;
}

@keyframes cases3d-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.35); }
    50%      { box-shadow: 0 0 0 9px rgba(201, 168, 76, 0); }
}

/* ---------------- برگه گزارش داخل پرونده ---------------- */
.case3d-panel {
    position: absolute;
    bottom: 22px;
    right: 50%;
    transform: translateX(50%) translateY(16px);
    width: min(560px, calc(100% - 36px));
    max-height: calc(100% - 44px);
    overflow-y: auto;
    cursor: pointer;             /* کل برگه لینک متن کامل است */
    /* کاغذ خط‌دار: فقط خطوط افقی کم‌رنگ، بدون خط حاشیه عمودی */
    background:
        repeating-linear-gradient(180deg, transparent 0 30px, rgba(88, 128, 168, 0.14) 30px 31px),
        linear-gradient(180deg, #fefcf5, #f8f3e4);
    border-radius: 4px 4px var(--radius-md) var(--radius-md);
    border: 1px solid #e3d9bd;
    box-shadow:
        0 1px 0 #fff inset,
        0 24px 60px rgba(0, 0, 0, 0.45),
        6px 6px 0 -2px rgba(230, 222, 196, 0.9),   /* برگه‌های زیری */
        12px 12px 0 -4px rgba(214, 204, 172, 0.7);
    padding: 24px 28px 20px 26px;
    opacity: 0;
    transition: opacity 0.28s ease, transform 0.28s ease;
    z-index: 3;
}

.case3d-panel:hover .case3d-panel-link {
    background: var(--teal);
}

.case3d-paper-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid rgba(27, 42, 74, 0.55);
    padding-bottom: 9px;
    margin-bottom: 12px;
}

.case3d-paper-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: 1px;
}

.case3d-panel.is-open {
    opacity: 1;
    transform: translateX(50%) translateY(0);
}

.case3d-panel-close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--light-gray);
    background: var(--white);
    color: var(--medium-gray);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}

.case3d-panel-close:hover {
    background: var(--navy);
    color: #fff;
}

.case3d-panel-cat {
    display: inline-block;
    background: var(--teal-bg);
    color: var(--teal);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.case3d-panel h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.75;
    margin-bottom: 10px;
}

.case3d-panel-summary {
    font-size: 14px;
    color: var(--dark-gray);
    line-height: 2.05;
    margin-bottom: 16px;
}

.case3d-panel-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.case3d-panel-metrics > div {
    background: var(--white);
    border: 1px dashed #d8cba6;
    border-radius: var(--radius-md);
    padding: 10px 8px;
    text-align: center;
}

.case3d-panel-metrics strong {
    display: block;
    color: var(--teal);
    font-size: 15px;
    font-weight: 900;
    line-height: 1.5;
}

.case3d-panel-metrics span {
    display: block;
    color: var(--medium-gray);
    font-size: 11.5px;
    margin-top: 3px;
}

.case3d-panel-link {
    display: inline-block;
    background: var(--navy);
    color: #fff;
    padding: 11px 22px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    transition: var(--transition);
}

/* عنوان فهرست متنی زیر صحنه */
.cases-text-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 34px 0 22px;
    color: var(--navy);
    font-size: 19px;
    font-weight: 800;
}

.cases-text-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--light-gray), transparent);
}

/* ---------------- ریسپانسیو ---------------- */
@media (max-width: 992px) {
    .cases3d-stage { height: 540px; }
}

@media (max-width: 640px) {
    .cases3d-stage { height: 460px; }
    .cases3d-hint { font-size: 12px; padding: 8px 14px; width: max-content; max-width: calc(100% - 30px); }
    .case3d-panel { padding: 20px 18px 16px; bottom: 12px; }
    .case3d-panel-metrics { grid-template-columns: 1fr 1fr; }
    .case3d-panel-metrics > div:last-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
    .cases3d-hint { animation: none; }
}
