/* متغیرهای رنگی */
:root {
    --brand-1: #10B981;
    --brand-2: #0EA5E9;
    --ink: #0B1220;
    --glass: rgba(255, 255, 255, .65);

    /* Light Theme Base Colors */
    --body-bg: #f9fafb;
    --body-color: #0f172a;
    --header-footer-bg: rgba(255, 255, 255, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(2, 6, 23, 0.06);
    --divider-bg: linear-gradient(90deg, transparent, rgba(2, 6, 23, .2), transparent);
}

/* تعریف رنگ‌ها برای حالت‌های روشن و تاریک */
:root {
    --color-bg-primary: white;
    --color-bg-secondary: #f9fafb; /* light gray */
    --color-text-primary: #1f2937; /* slate-800 */
    --color-text-secondary: #4b5563; /* slate-600 */
    --color-border: #e5e7eb;
    --color-overall-bg: #ecfdf5; /* emerald-50 */
    --color-overall-border: #d1fae5; /* emerald-100 */
    --color-overall-text: #047857; /* emerald-700 */
    --color-link-primary: #0284c7; /* sky-600 */
}

/* 🌙 Dark Mode Support (اگر قبلاً تعریف نکرده‌اید) */
/* فرض می‌کنیم که حالت تاریک با کلاس .dark-mode یا مشابه فعال می‌شود */
/* اگر از روش دیگری استفاده می‌کنید، سلکتور را تغییر دهید */
body.dark {
    --color-bg-primary: #1f2937; /* dark slate */
    --color-bg-secondary: #374151;
    --color-text-primary: #f9fafb;
    --color-text-secondary: #d1d5db;
    --color-border: #4b5563;
    --color-overall-bg: #064e3b; /* dark emerald */
    --color-overall-border: #14532d;
    --color-overall-text: #a7f3d0;
    --color-link-primary: #38bdf8;
}

/* Base Typography */
html, body {
    font-family: Vazirmatn, Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: all 0.3s ease; /* برای انیمیشن تغییر تم */
    background-color: var(--body-bg);
    color: var(--body-color);
}

/* Background Blobs */
.blob {
    position: absolute;
    filter: blur(60px);
    opacity: .5;
    mix-blend: multiply;
    border-radius: 50%;
    z-index: -1; /* اطمینان از قرارگیری پشت عناصر */
}

.b1 {
    background: radial-gradient(closest-side, #34D399, transparent);
    width: 36rem;
    height: 36rem;
    right: -10rem;
    top: -12rem;
    animation: float1 18s ease-in-out infinite;
}

.b2 {
    background: radial-gradient(closest-side, #60A5FA, transparent);
    width: 28rem;
    height: 28rem;
    left: -8rem;
    bottom: -10rem;
    animation: float2 22s ease-in-out infinite;
}

.b3 {
    background: radial-gradient(closest-side, #FBBF24, transparent);
    width: 24rem;
    height: 24rem;
    left: 20%;
    top: 30%;
    animation: float3 24s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% {
        transform: translateY(0)
    }
    50% {
        transform: translateY(30px)
    }
}

@keyframes float2 {
    0%, 100% {
        transform: translate(0, 0)
    }
    50% {
        transform: translate(20px, -20px)
    }
}

@keyframes float3 {
    0%, 100% {
        transform: translateX(0)
    }
    50% {
        transform: translateX(-25px)
    }
}

/* Glass card (Global) */
.glass {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
}

/* Gradient border utility */
.g-border {
    position: relative;
}

.g-border:before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Fancy button (General styles defined by Tailwind, here for custom effects) */
.btn {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, background 0.2s; /* اضافه شدن ترنزیشن برای هاور */
}

/* Button default brand colors */
.btn:not(.g-border) {
    background: #10b981;
}

.btn:not(.g-border):hover {
    transform: translateY(-2px);
    background: #0ea5e9;
}


.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    opacity: 0;
    transition: opacity .25s;
}

.btn:hover::after {
    opacity: .12;
}

/* Elevation hover */
.elev:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 50px -20px rgba(0, 0, 0, .35);
}

/* Section divider */
.divider {
    height: 1px;
    background: var(--divider-bg);
}

/* Header/Footer Default Styles (Non-Dark) */
header, footer {
    background-color: var(--header-footer-bg);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(2, 6, 23, 0.1);
}

/* Badge style */
.badge {
    background: #f1f5f9;
    border-radius: 9999px;
}

#openSpeakingBooking {
    position: relative;
    z-index: 9999;
    pointer-events: auto;
}

/* === Dark theme overrides === */
body.dark {
    /*--body-bg: #0f172a;*/
    --body-bg: #273249;
    --body-color: #f8fafc;
    --header-footer-bg: rgba(15, 23, 42, .8);
    --glass-bg: rgba(255, 255, 255, .2);
    --glass-border: rgba(255, 255, 255, .1);
    --divider-bg: linear-gradient(90deg, transparent, rgba(148, 163, 184, .25), transparent);

    background-color: var(--body-bg) !important;
    color: var(--body-color) !important;
}

body.dark header,
body.dark footer,
body.dark .glass {
    background: var(--header-footer-bg) !important;
    color: var(--body-color) !important;
    border-color: var(--glass-border) !important;
}

body.dark .text-slate-600 {
    color: #cbd5e1 !important;
}

body.dark .text-slate-800 {
    color: #f1f5f9 !important;
}

body.dark .text-slate-500 {
    color: #94a3b8 !important;
}

body.dark .bg-white,
body.dark .bg-slate-50 {
    background: #1e293b !important;
    border-color: #334155 !important; /* برای border-slate-200 */
}

body.dark .border-slate-200,
body.dark .border-slate-200\/70 {
    border-color: #334155 !important;
}

body.dark .bg-gradient-to-b.from-slate-50.via-white.to-slate-50 {
    background: linear-gradient(to bottom, #0f172a, #0b1220, #0f172a) !important;
}

/* Dark Mode Button Overrides */
body.dark .btn:not(.g-border) {
    background-color: #10b981 !important;
}

body.dark .btn:not(.g-border):hover {
    background-color: #0ea5e9 !important;
}

body.dark .btn.g-border {
    background-color: rgba(15, 23, 42, .8) !important;
    color: #f8fafc !important;
}

/* Keep brand gradients vibrant in dark */
body.dark .g-border:before {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
}

/* Extra CSS */
.exam-small-logo {
    max-width: 50px;
    max-height: 50px;
}

.exam-md-logo {
    max-width: 200px;
    max-height: 200px;
}

/* --- کلاس‌های اصلی کانتینر --- */
.report-sheet-container {
    padding: 30px; /* شبیه p-6 md:p-8 */
    margin-top: 20px;
    background-color: var(--color-bg-primary);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: var(--color-text-primary);
}

.report-section {
    margin-top: 24px; /* mt-6 */
    display: grid;
    gap: 24px; /* gap-6 */
    grid-template-columns: 1fr; /* Default to one column */
}

/* --- ساختارهای ستونی --- */
@media (min-width: 768px) {
    /* md: */
    .two-columns-layout {
        grid-template-columns: 2fr 1fr; /* md:grid-cols-3, but the first column spans 2/3 */
    }

    .scores-layout {
        grid-template-columns: 1fr 2fr; /* مدلی دیگر از md:grid-cols-3 */
    }

    .verification-footer {
        grid-template-columns: 1fr 2fr; /* md:grid-cols-3 */
        align-items: flex-end; /* items-end */
    }

    .candidate-info {
        grid-column: span 2 / span 2; /* md:col-span-2 */
    }

    .band-descriptors {
        grid-column: span 2 / span 2; /* md:col-span-2 */
    }

    .signature-info {
        grid-column: span 2 / span 2; /* md:col-span-2 */
    }
}

/* --- کلاس کارت (Panel) --- */
.report-card {
    background-color: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px; /* p-4 */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card-title {
    font-weight: 800; /* font-extrabold */
    margin-bottom: 8px; /* mb-2 */
    font-size: 1.125rem;
}

/* --- Header --- */
.report-header-gradient {
    background-image: linear-gradient(to right, #10b981, #0ea5e9); /* hdr-grad */
    border-radius: 16px; /* rounded-2xl */
    padding: 24px; /* p-5 md:p-6 */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px; /* gap-4 */
    color: white; /* متن هدر همیشه سفید باشد */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px; /* gap-3 */
}

.header-icon {
    flex-shrink: 0;
}

.header-title {
    font-size: 1.25rem; /* text-xl */
    font-weight: 900; /* font-black */
}

.header-subtitle {
    font-size: 0.75rem; /* text-xs */
    line-height: 1.25; /* /5 */
    opacity: 0.9;
}

.header-details {
    display: grid;
    gap: 4px; /* gap-1 */
    font-size: 0.875rem; /* text-sm */
    text-align: right;
}

.detail-badge {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

/* --- جدول کلید-مقدار (Key-Value Table) --- */
.report-kv-table {
    width: 100%;
    font-size: 0.875rem; /* text-sm */
    border-collapse: collapse;
}

.report-kv-table th, .report-kv-table td {
    padding: 4px 0;
    text-align: right;
    border-bottom: 1px solid var(--color-border);
}

.report-kv-table th {
    font-weight: normal;
    text-align: left;
    color: var(--color-text-secondary);
    padding-left: 10px;
}

.report-kv-table tr:last-child th,
.report-kv-table tr:last-child td {
    border-bottom: none;
}

/* --- Overall Band Box --- */
.overall-band-box {
    margin-top: 12px; /* mt-3 */
    padding: 12px; /* p-3 */
    border-radius: 12px; /* rounded-xl */
    background-color: var(--color-overall-bg);
    border: 1px solid var(--color-overall-border);
    font-size: 0.875rem; /* text-sm */
    color: var(--color-text-primary);
    direction: ltr;
}

.overall-score-value {
    font-weight: 900; /* font-black */
    color: var(--color-overall-text);
}

.cefr-pill {
    display: inline-block;
    padding: 2px 6px;
    margin-right: 5px;
    border-radius: 9999px; /* rounded-full */
    font-size: 0.75rem;
    font-weight: bold;
    background-color: var(--color-overall-text);
    color: var(--color-overall-bg);
}

/* --- Band Descriptors List --- */
.descriptor-list {
    font-size: 0.875rem; /* text-sm */
    color: var(--color-text-secondary); /* text-slate-700 */
    line-height: 1.75rem; /* leading-7 */
    list-style-type: disc;
    padding-right: 24px; /* pr-6 */
}

/* --- Footer / Verification --- */
.verification-content {
    display: flex;
    align-items: center;
    gap: 12px; /* gap-3 */
}

.qr-code {
    /* placeholder for QR code */
    width: 80px;
    height: 80px;
    background-color: var(--color-text-secondary);
    border-radius: 4px;
    flex-shrink: 0;
}

.verification-text {
    font-size: 0.75rem; /* text-xs */
    color: var(--color-text-secondary);
}

.verify-link {
    color: var(--color-link-primary);
    text-decoration: underline;
}

.copy-button {
    margin-top: 12px; /* mt-3 */
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 8px 12px; /* px-3 py-2 */
    font-size: 0.875rem; /* text-sm */
    cursor: pointer;
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
    transition: background-color 0.3s;
}

.copy-button:hover {
    background-color: var(--color-border);
}

.signature-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.signature-text {
    font-size: 0.875rem; /* text-sm */
}

.digital-signature {
    color: var(--color-text-secondary); /* text-slate-600 */
}

.signature-stamp {
    text-align: center;
}

.stamp-icon {
    font-size: 2rem; /* text-3xl */
}

.stamp-label {
    font-size: 0.75rem; /* text-xs */
    margin-top: 4px; /* mt-1 */
}

/* --- Watermark (فقط برای زیبایی) --- */
.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.05;
    font-size: 15vw;
    font-weight: 900;
    color: var(--color-text-secondary);
    pointer-events: none;
    content: "MOCK TEST";
    z-index: 0;
}

/* استایل دکمه‌های آیکون شبکه‌های اجتماعی
      این کلاس‌ها افکت شیشه‌ای و هاور را اعمال می‌کنند
    */
.social-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem; /* 56px */
    height: 3.5rem; /* 56px */
    border-radius: 9999px; /* rounded-full */
    color: var(--ink, #0B1220); /* رنگ آیکون در حالت روشن */
    transition: all 0.2s ease-in-out;
}

.social-icon-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    color: var(--brand-1, #10B981); /* رنگ هاور */
}

/* حالت تاریک */
.dark .social-icon-btn {
    color: #f8fafc; /* رنگ آیکون در حالت تاریک */
}

.dark .social-icon-btn:hover {
    color: var(--brand-1, #10B981);
}

.img-fluid {
    align-items: center !important;
    display: block;
    margin: 0 auto;
    /*max-width: 100%;*/
    max-height: 22em;
    padding: 10px;
}
