/* تعریف فونت عادی */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../assets/fonts/Vazirmatn.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* تعریف فونت ضخیم (Bold) */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../assets/fonts/Vazirmatn-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

/* اعمال فونت به کل کارت ویزیت */
body, .business-card {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

/* استفاده از حالت ضخیم برای عناوین */
.card-title, h1, h2, strong {
    font-weight: bold;
}

:root {
    --bg-color: #111827;
    --card-bg: #1F2937;
    --card-border: rgba(255, 255, 255, 0.08);
    --primary-color: #8b643e;
    --primary-hover: #c59f2d;
    --text-color: #FFFFFF;
    --secondary-text: #9CA3AF;
    --accent-color: #c4f163;
    
    --btn-gradient: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    --btn-gradient-hover: linear-gradient(135deg, #9333ea 0%, #db2777 100%);
    
    --font-family: 'Vazirmatn', Tahoma, sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-pill: 50px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --transition: all 0.2s ease-in-out;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    direction: rtl;
    text-align: right;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    -webkit-tap-highlight-color: transparent;
}

.vcard-container {
    width: 100%;
    max-width: 480px;
    background-color: var(--bg-color);
    padding: 0 16px 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0 auto;
}

.cover-container {
    position: relative;
    width: calc(100% + 32px);
    margin-right: -16px;
    margin-left: -16px;
    height: 160px;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    overflow: visible;
}

.cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

.profile-logo-wrapper {
    position: absolute;
    bottom: -36px;
    left: 20px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 3px solid var(--primary-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-name {
    font-size: clamp(1.4rem, 4vw, 1.7rem);
    font-weight: 800;
    line-height: 1.2;

    /* رنگ گرادینت طلایی/پرینت پریمیوم */
    background: linear-gradient(135deg, #ffffff 0%, #F6EDE8 50%, #B38754 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    /* سایه نرم پشت گرادینت */
    filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.7));
}

.profile-title {
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
    font-weight: 400;
    color: var(--secondary-text);
}

.profile-brand {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-top: 2px;
}

.profile-tagline {
    font-size: 0.85rem;
    color: var(--secondary-text);
    margin-top: 6px;
    opacity: 0.9;
}

#cardAddress {
    color: var(--accent-color);
}
#cardAddress2 {
    color: var(--accent-color);
}

.icon { width: 22px; height: 22px; }
.icon-sm { width: 18px; height: 18px; }
.icon-md { width: 20px; height: 20px; }

.action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.action-btn {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);

}

.action-btn:hover, .action-btn:focus-visible {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    color: #d7ff75;
    text-shadow: 0 0 8px rgba(196, 241, 99, 0.4);
}

.action-btn:active { transform: scale(0.96); }

.card-box {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-text);
}

.card-title-center {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.social-links { display: flex; gap: 10px; }

.social-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

/* حالت معمولی دکمه اینستاگرام */
.social-pill.instagram {
    background: rgba(225, 48, 108, 0.1);
    color: #e1306c;
    border: 1px solid rgba(225, 48, 108, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* افکت هوور جذاب با گرادینت واقعی اینستاگرام */
.social-pill.instagram:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(225, 48, 108, 0.35);
    transform: translateY(-2px); /* بالا آمدن جزئی دکمه در زمان هوور */
}

/* برای اینکه آیکون و متن در حالت هوور به نرمی سفید شوند */
.social-pill.instagram:hover svg {
    stroke: #ffffff;
}

.social-pill.telegram {
    background: rgba(37, 99, 235, 0.12);
    color: #3b82f6;
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.social-pill.whatsappchannel {
    background: rgba(37, 211, 102, 0.12);
    color: #25D366;
    border: 1px solid rgba(37, 211, 102, 0.3);
    transition: all 0.2s ease-in-out;
}

.social-pill.whatsappchannel:hover {
    background: #25D366;
    color: #0b381a; /* سبز بسیار تیره برای ایجاد کنتراست بالا */
    border-color: #25D366;
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 4px;
}

.service-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.service-name2 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #c4f163;
    margin-left: auto;
}

.service-action {
    color: #10b981;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
}

.service-action2 {
    color: #c4f163;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.service-action2:hover {
    color: #d7ff75;
    text-shadow: 0 0 8px rgba(196, 241, 99, 0.4);
}

.service-action3 {
    color: #ff3f33;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
}

.service-action4 {
    color: #9cc1fd;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
}

.service-action5 {
    color: #95f5d5;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
}

.main-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-primary {
    background: var(--btn-gradient);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--btn-gradient-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    color: #d7ff75;
    text-shadow: 0 0 8px rgba(196, 241, 99, 0.4);
}

.share-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.share-btn {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 10px;
    color: var(--text-color);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.share-btn:hover {
    color: #d7ff75;
    text-shadow: 0 0 8px rgba(196, 241, 99, 0.4);
}

.share-btn.full-width { width: 100%; }

.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
}

.qr-card {
    background-color: #888787;
    padding: 4px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.qr-img {
    display: block;
    width: 160px;
    height: 160px;
    border-radius: var(--radius-sm);
}

.qr-caption {
    font-size: 0.75rem;
    color: var(--secondary-text);
    text-align: center;
}

.footer {
    text-align: center;
    font-size: 0.75rem;
    color: #d7ff75;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #374151;
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
    pointer-events: none;
    border: 1px solid var(--primary-color);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* مخفی کردن کانتینر عکس بدون آسیب به محاسبه ابعاد html2canvas */
#screenshotWrapper {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 480px; /* یا عرض دلخواه کارت ویزیت شما */
    z-index: -1000;
    pointer-events: none;
    visibility: visible;
}