/* ==========================================================
   modules/demo/demo.css
   استایل‌های دمو – نسخهٔ کامل با حفظ استایل گزارش
   ========================================================== */

/* ---------- Overlay ---------- */
.demo-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 25, 40, 0.75);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.demo-overlay.active {
    display: flex;
}

/* ---------- کاغذ A4 عمودی ---------- */
.demo-a4-paper {
    background: #fff;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.05);
    border-radius: 2px;
    width: 160mm;
    height: 297mm;
    max-width: 90vw;
    max-height: 90vh;
    aspect-ratio: 160 / 297;
    padding: 10mm;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

@media (max-width: 160mm) {
    .demo-a4-paper {
        width: 90vw;
        height: calc(90vw * 297 / 160);
    }
}

/* ---------- کارت کارنامه (دموی تنظیمات کارنامه) ---------- */
.demo-karnameh-card {
    border: 1px dashed #adb5bd;
    border-radius: 6px;
    padding: 10px;
    background: #fafafa;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
}

.karnameh-header {
    border-bottom: 2px solid #f0c040;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.karnameh-title p {
    margin: 2px 0;
    text-align: center;
    font-weight: bold;
}

.karnameh-info table {
    width: 100%;
    margin-top: 8px;
    border-collapse: collapse;
}

.karnameh-info td {
    padding: 4px 8px;
    border: 1px solid #dee2e6;
}

.karnameh-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.karnameh-table th,
.karnameh-table td {
    border: 1px solid #adb5bd;
    padding: 6px;
    text-align: center;
}

.karnameh-table th {
    background: #f8f9fa;
}

.karnameh-footer {
    border-top: 2px solid #f0c040;
    padding-top: 8px;
    margin-top: 12px;
    text-align: center;
    font-weight: bold;
}

.mini-card-header {
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 4px;
    margin-bottom: 6px;
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
    margin: 6px 0;
}

.mini-table td {
    border: 1px solid #dee2e6;
    padding: 3px 6px;
    text-align: center;
}

.mini-card-footer {
    text-align: center;
    font-weight: bold;
    margin-top: 4px;
    border-top: 1px solid #dee2e6;
    padding-top: 4px;
}

/* ---------- کارت گزارش توصیفی ---------- */
.demo-report-card {
    font-size: 12px !important;
    line-height: 1.5;
    color: #000;
    background: #fff;
}

.demo-report-card table {
    border-collapse: collapse;
    width: 100%;
    font-size: inherit;
}

.demo-report-card td,
.demo-report-card th {
    border: 1px solid #adb5bd;
    padding: 1px 2px;
    vertical-align: top;
}

.demo-report-card th {
    background: #f0f0f0;
    font-weight: bold;
    text-align: center;
}

/* ---------- فقط ستون اول جدول اصلی گزارش عمودی شود ---------- */
.report-table td:first-child,
.report-table th:first-child {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    vertical-align: middle;
    text-align: center;
    white-space: nowrap;
    transform: rotate(180deg);
    padding: 4px 2px;
}

/* ---------- هدر گزارش ---------- */
.report-header {
    display: flex;
    border-bottom: 1px solid #f0c040;
    padding-bottom: 4px;
    margin-bottom: 4px;
}

.report-emblem {
    width: 20%;
    text-align: center;
    font-weight: bold;
}

.report-school-info,
.report-student-info {
    width: 35%;
    padding: 0 2px;
}

.report-photo {
    width: 10%;
    text-align: center;
}

.report-table {
    margin: 4px 0;
}

.report-footer {
    border-top: 1px solid #f0c040;
    padding-top: 4px;
    margin-top: 4px;
}

/* ---------- پنل تنظیمات (مشترک) ---------- */
.demo-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 280px;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    font-size: 13px;
    display: none;
    z-index: 10000;
}

.demo-panel.active {
    display: block;
}

.demo-panel-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #1e2a78;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

.demo-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.demo-control-row span {
    width: 60px;
    font-weight: bold;
    font-size: 12px;
}

.demo-btn {
    width: 28px;
    height: 26px;
    border: none;
    border-radius: 4px;
    background: #e5e7eb;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.demo-btn:hover {
    background: #d1d5db;
}

.demo-btn.danger {
    background: #fecaca;
    color: #b91c1c;
}

.demo-btn.success {
    background: #bbf7d0;
    color: #166534;
}

.demo-display {
    width: 34px;
    text-align: center;
    font-weight: bold;
    color: #1d4ed8;
}

.demo-tooltip {
    position: absolute;
    background: #111827;
    color: #fff;
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 6px;
    transform: translateY(-120%);
    white-space: nowrap;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-140%); }
    to { opacity: 1; transform: translateY(-120%); }
}

/* اسلایدرهای ستون */
#col-sliders-container input[type=range] {
    height: 6px;
}

@media (max-width: 600px) {
    .demo-panel {
        width: 240px;
        right: 10px;
        bottom: 10px;
    }
}