/* ==========================================================================
   قالب کارت استاندارد مسابقات پیکار (A6 Competition Badge CSS)
   ========================================================================== */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

.paikar-badge-container,
.paikar-badge-card,
.paikar-badge-card * {
    font-family: 'Vazirmatn', 'Vazir', Tahoma, sans-serif !important;
    box-sizing: border-box;
}

.paikar-badge-container {
    width: 100%;
    display: flex;
    justify-content: center;
    direction: rtl;
    text-align: right;
}

.paikar-badge-card {
    width: 100%;
    max-width: 340px;
    height: auto;
    min-height: 480px;
    background: #ffffff;
    border: 2px solid #0f172a;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    position: relative;
    box-sizing: border-box;
}

/* سربرگ کارت */
.paikar-badge-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-bottom: 3px solid #ff6b00;
    text-align: center;
    position: relative;
    min-height: 52px;
}
.paikar-badge-organizer-box {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 40px;
}
.paikar-badge-organizer-logo {
    max-height: 38px;
    max-width: 130px;
    object-fit: contain;
    display: block;
}
.paikar-badge-event-title {
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.35;
    color: #ffffff;
    text-align: center;
}

/* بدنه کارت */
.paikar-badge-body {
    padding: 10px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fafafa;
}

.paikar-badge-photo-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 12px;
}
.paikar-badge-photo {
    width: 80px;
    height: 98px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #0f172a;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    background: #ffffff;
}
.paikar-badge-role {
    display: inline-block;
    background: #ff6b00;
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px;
    margin-top: -8px;
    position: relative;
    z-index: 2;
    white-space: nowrap;
    max-width: 160px;
    text-overflow: ellipsis;
    overflow: hidden;
}

.paikar-badge-athlete-name {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin: 8px 0 10px 0;
    text-align: center;
    line-height: 1.3;
}

.paikar-badge-meta-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 8px;
    background: #ffffff;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.badge-meta-item {
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.25;
}
.badge-meta-item .meta-label {
    color: #64748b;
    font-size: 9.5px;
    font-weight: 500;
}
.badge-meta-item .meta-value {
    font-weight: 700;
    color: #0f172a;
    font-size: 11px;
}
.badge-meta-item .meta-value.highlight-weight {
    color: #ff6b00;
    font-size: 12px;
    font-weight: 800;
}
.font-mono {
    font-family: monospace, 'Vazirmatn';
    letter-spacing: 0.5px;
}

/* پاورقی کارت: QR Code و تاییدیه داوران */
.paikar-badge-footer {
    background: #ffffff !important;
    border-top: 1px dashed #cbd5e1;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: auto;
    min-height: 70px;
    box-sizing: border-box;
}
.paikar-badge-qr-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex-shrink: 0;
    width: 68px;
    min-width: 68px;
}
.paikar-badge-qrcode {
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    background: #ffffff !important;
    padding: 2px;
    box-sizing: border-box;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.paikar-badge-qrcode canvas,
.paikar-badge-qrcode img {
    width: 58px !important;
    height: 58px !important;
    max-width: 58px !important;
    max-height: 58px !important;
    display: block !important;
    margin: 0 auto !important;
    image-rendering: pixelated;
}
.paikar-badge-qrcode canvas + img,
.paikar-badge-qrcode canvas ~ img {
    display: none !important;
}
.qr-hint {
    font-size: 8px;
    color: #64748b;
    white-space: nowrap;
    line-height: 1;
}

.paikar-badge-footer-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    overflow: hidden;
}
.badge-code {
    font-size: 11.5px;
    color: #0f172a;
    line-height: 1.2;
}
.badge-code strong {
    font-weight: 800;
}
.badge-status-tag {
    display: inline-block;
    background: #ecfdf5;
    color: #047857;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    align-self: flex-start;
    white-space: nowrap;
    line-height: 1.2;
}
.paikar-mini-brand {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    margin-top: 2px !important;
    opacity: 0.85;
    max-height: 16px !important;
    overflow: hidden !important;
}
.paikar-badge-card .paikar-mini-logo,
.paikar-mini-brand img,
img.paikar-mini-logo {
    height: 14px !important;
    max-height: 14px !important;
    width: 44px !important;
    max-width: 44px !important;
    min-width: 36px !important;
    object-fit: contain !important;
    display: inline-block !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
}
.paikar-mini-brand span {
    font-size: 8.5px !important;
    color: #94a3b8 !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    line-height: 1 !important;
}

/* ==========================================================================
   قوانین پرینت مستقیم (Print Stylesheet)
   ========================================================================== */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    #wpadminbar,
    header,
    footer,
    nav,
    aside,
    .site-header,
    .site-footer,
    .elementor-location-header,
    .elementor-location-footer,
    .paikar-portal-header,
    .paikar-tabs-nav,
    .paikar-tab-content,
    .athlete-actions,
    .modal-header,
    .modal-footer,
    .modal-close,
    #paikar-alert-box,
    .paikar-multi-comps-banner,
    .btn-action,
    .button {
        display: none !important;
    }

    .paikar-modal-overlay {
        position: static !important;
        background: transparent !important;
        padding: 0 !important;
        display: block !important;
        inset: auto !important;
    }

    .paikar-modal-box {
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .modal-body {
        padding: 0 !important;
    }

    .paikar-badge-container {
        display: flex !important;
        justify-content: center !important;
        margin: 0 auto !important;
        page-break-inside: avoid;
    }

    .paikar-badge-card {
        box-shadow: none !important;
        border: 2px solid #0f172a !important;
        page-break-inside: avoid;
    }
}
