/* ===== Card Delivery - Modern Centered Design ===== */
.cc-delivery-wrap {
    min-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-family: Tahoma, Arial, sans-serif;
    direction: rtl;
    box-sizing: border-box;
}

/* The main card — always centered on screen (search box + print button) */
.cc-delivery-card {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(26, 26, 46, 0.12), 0 4px 16px rgba(26, 26, 46, 0.06);
    overflow: hidden;
    position: relative;
}

/* Header */
.cc-delivery-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 28px 30px 24px;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.cc-delivery-header::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.cc-delivery-header::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -20px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.cc-delivery-icon {
    margin-bottom: 8px;
    opacity: 0.95;
}

.cc-delivery-header h2 {
    font-size: 24px;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.cc-delivery-header p {
    opacity: 0.85;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

/* Form */
.cc-delivery-form {
    padding: 22px 26px 14px;
}

.cc-input-group {
    display: flex;
    gap: 0;
    border: 2px solid #e0e0e0;
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.cc-input-group:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102,126,234,0.15);
}

.cc-input-icon {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #f8f9ff;
}

.cc-input-group input {
    flex: 1;
    min-width: 0;
    padding: 15px 10px;
    border: none;
    font-size: 17px;
    text-align: center;
    font-family: Tahoma;
    outline: none;
    background: transparent;
}

.cc-input-group button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 92px;
    padding: 15px 22px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    font-size: 15px;
    cursor: pointer;
    font-family: Tahoma;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.cc-input-group button:hover { opacity: 0.92; }
.cc-input-group button:disabled { opacity: 0.65; cursor: wait; }

/* Search spinner */
.cc-btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cc-spin 0.7s linear infinite;
}
@keyframes cc-spin { to { transform: rotate(360deg); } }

/* Hint under search */
.cc-delivery-hint {
    margin-top: 10px;
    font-size: 11.5px;
    color: #a0a6c3;
    text-align: center;
}

/* ===== Re-issue Warning (red — hard to miss) ===== */
.cc-reissue-warning {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 26px 0;
    padding: 13px 16px;
    background: linear-gradient(135deg, #ff5f6d 0%, #e6273a 100%);
    border-radius: 14px;
    color: #fff;
    animation: cc-shake 0.5s ease;
    box-shadow: 0 6px 18px rgba(230, 39, 58, 0.35);
}

@keyframes cc-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.cc-reissue-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cc-reissue-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 13px;
    line-height: 1.6;
}

.cc-reissue-text strong {
    font-size: 15px;
}

.cc-reissue-text b {
    font-size: 15px;
    padding: 0 3px;
}

/* ===== User Result ===== */
.cc-user-result {
    padding: 20px 26px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: cc-fade-in 0.25s ease;
}

@keyframes cc-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.cc-user-top {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.cc-user-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0f2ff 0%, #e8ecff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cc-user-info {
    text-align: right;
    min-width: 0;
}

.cc-user-name {
    font-size: 21px;
    font-weight: bold;
    color: #1a1a2e;
    margin-bottom: 5px;
    word-break: break-word;
}

.cc-user-id-display {
    font-size: 13px;
    color: #667eea;
    direction: ltr;
    font-family: monospace;
    background: #f0f2ff;
    padding: 5px 14px;
    border-radius: 20px;
    display: inline-block;
    max-width: 100%;
    word-break: break-all;
    line-height: 1.5;
}

.cc-user-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

/* Print button — big and obvious */
.cc-print-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
    font-family: Tahoma;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 18px rgba(17, 153, 142, 0.35);
}

.cc-print-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(17, 153, 142, 0.45);
}

.cc-print-btn:active { transform: translateY(0); }
.cc-print-btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
.cc-print-btn:focus-visible { outline: 3px solid rgba(17,153,142,0.4); outline-offset: 2px; }

/* Error Message */
.cc-error-msg {
    margin: 10px 26px 22px;
    padding: 13px 16px;
    border-radius: 14px;
    text-align: center;
    font-size: 14px;
    display: none;
}

.cc-error-msg:empty { display: none; }

.cc-error-msg:not(:empty) {
    display: block;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(238, 90, 36, 0.3);
    animation: cc-fade-in 0.25s ease;
}

/* ===== Toast ===== */
.cc-delivery-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    padding: 13px 24px;
    border-radius: 14px;
    color: #fff;
    font-size: 14px;
    font-family: Tahoma, Arial, sans-serif;
    z-index: 999999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    max-width: 90vw;
    text-align: center;
    display: none;
}

.cc-toast-success { background: linear-gradient(135deg, #11998e, #38ef7d); }
.cc-toast-error { background: linear-gradient(135deg, #ff5f6d, #e6273a); }
.cc-toast-warning { background: linear-gradient(135deg, #f7971e, #ffd200); color: #1a1a2e; }

/* === VIP/Lunch Badges (color-coded) === */
.cc-badge-vip, .cc-badge-lunch {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    margin: 2px;
}
.cc-badge-vip.yes { background: #00c853; color: #fff; }
.cc-badge-vip.no { background: #ff1744; color: #fff; }
.cc-badge-lunch.yes { background: #00c853; color: #fff; }
.cc-badge-lunch.no { background: #ff1744; color: #fff; }

.cc-user-badges {
    margin-top: 2px;
    text-align: right;
}

/* === Print Size Selector === */
.cc-print-size-select {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}
.cc-print-size-select label { font-weight: bold; }
.cc-print-size-select select {
    padding: 7px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: Tahoma;
    font-size: 13px;
    cursor: pointer;
    background: #fafbff;
}
.cc-print-size-select select:focus {
    outline: none;
    border-color: #667eea;
}

/* Mobile */
@media (max-width: 480px) {
    .cc-delivery-wrap { padding: 12px 8px; min-height: 80vh; }
    .cc-delivery-form { padding: 18px 16px 10px; }
    .cc-user-result { padding: 16px 16px 20px; }
    .cc-reissue-warning { margin: 10px 16px 0; }
    .cc-error-msg { margin: 10px 16px 18px; }
    .cc-input-group input { font-size: 16px; }
    .cc-user-top { flex-direction: column; align-items: center; }
    .cc-user-info { text-align: center; }
    .cc-user-badges { text-align: center; }
}

/* === BIG VIP/Lunch Status Rows (operator emphasis at issuance — all 4 combos) === */
.cc-user-badges {
    display: block;
    width: 100%;
    max-width: 420px;
    margin: 10px auto 6px;
    text-align: right;
}
.cc-status-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}
.cc-status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    font-family: Tahoma;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.cc-status-row svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}
.cc-status-row .cc-status-label {
    flex: 1;
    text-align: right;
}
.cc-status-row .cc-status-value {
    font-size: 22px;
}
.cc-status-row.yes {
    background: linear-gradient(135deg, #00c853, #009624);
}
.cc-status-row.no {
    background: linear-gradient(135deg, #ff1744, #c62828);
}
@media (max-width: 480px) {
    .cc-status-row { font-size: 16px; padding: 10px 12px; }
    .cc-status-row .cc-status-value { font-size: 19px; }
}

/* === v1.40 POSITION banner (screen-only, before the print button) ===
   Shows the imported «پوزیشن» (سخنران/پنل/غرفه‌دار/مهمان...) so the desk
   instantly sees who the visitor is. Empty / «شرکت کننده» → never shown.
   The printed card is a SEPARATE server-rendered document that does not
   include this element; the @media print guard below is belt-and-braces
   for Ctrl+P on the delivery page itself. */
.cc-position-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 26px 0;
    padding: 13px 18px;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    border-radius: 14px;
    color: #fff;
    box-shadow: 0 6px 18px rgba(245, 124, 0, 0.35);
    animation: cc-pop 0.35s ease;
}
.cc-position-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    flex-shrink: 0;
}
.cc-position-label {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.92;
    flex-shrink: 0;
}
.cc-position-text {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.2px;
    line-height: 1.4;
    word-break: break-word;
}
@keyframes cc-pop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
@media (max-width: 480px) {
    .cc-position-banner { margin: 12px 16px 0; }
    .cc-position-text { font-size: 17px; }
}
@media print {
    .cc-position-banner { display: none !important; }
}
