/**
 * Dima Social Share - Frontend Styles
 * Version: 1.0.0
 */

/* ═══════════ متغیرهای CSS ═══════════ */
.dima-share-section {
    --dima-bg: #141821;
    --dima-bg-hover: #1a1f2b;
    --dima-border: rgba(255,255,255,0.06);
    --dima-text: #e2e8f0;
    --dima-text-muted: #94a3b8;
    --dima-primary: #6366f1;
    --dima-primary-light: #818cf8;
    --dima-accent: #fbbf24;
    --dima-shadow: 0 4px 20px -4px rgba(0,0,0,0.4);
    --dima-radius: 16px;
    --dima-font: inherit;
    
    font-family: var(--dima-font);
    margin: 40px 0;
    direction: rtl;
}

/* تم روشن */
.dima-theme-light {
    --dima-bg: #ffffff;
    --dima-bg-hover: #f8fafc;
    --dima-border: rgba(0,0,0,0.08);
    --dima-text: #1e293b;
    --dima-text-muted: #64748b;
    --dima-shadow: 0 4px 20px -4px rgba(0,0,0,0.1);
}

/* ═══════════ کانتینر اصلی ═══════════ */
.dima-share-container {
    background: var(--dima-bg);
    border: 1px solid var(--dima-border);
    border-radius: var(--dima-radius);
    padding: 32px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--dima-shadow);
}

/* پس‌زمینه تزئینی */
.dima-share-container::before,
.dima-share-container::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.1;
    pointer-events: none;
}

.dima-share-container::before {
    top: -50px;
    left: -50px;
    background: var(--dima-primary);
}

.dima-share-container::after {
    bottom: -50px;
    right: -50px;
    background: var(--dima-accent);
}

/* ═══════════ هدر ═══════════ */
.dima-share-header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.dima-share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--dima-primary), #8b5cf6);
    color: white;
    font-size: 24px;
    margin-bottom: 16px;
    box-shadow: 0 0 40px -10px rgba(99,102,241,0.5);
}

.dima-share-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--dima-text);
    margin: 0 0 8px;
}

.dima-share-subtitle {
    font-size: 14px;
    color: var(--dima-text-muted);
    margin: 0;
}

/* ═══════════ شمارنده ═══════════ */
.dima-share-counter {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.dima-counter-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--dima-bg-hover);
    border: 1px solid var(--dima-border);
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 14px;
}

.dima-counter-badge i {
    color: #ef4444;
    font-size: 16px;
}

.dima-count {
    font-weight: bold;
    color: var(--dima-text);
}

.dima-count-label {
    color: var(--dima-text-muted);
    font-size: 12px;
}

/* ═══════════ شبکه‌های اجتماعی ═══════════ */
.dima-share-networks {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

@media (min-width: 576px) {
    .dima-share-networks {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .dima-share-networks {
        grid-template-columns: repeat(6, 1fr);
    }
}

.dima-share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--dima-bg-hover);
    border: 1px solid var(--dima-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.dima-share-btn:hover {
    border-color: var(--network-color, var(--dima-primary));
    transform: translateY(-4px);
}

.dima-share-btn:active {
    transform: scale(0.95);
}

.dima-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--network-color, var(--dima-primary)) 15%, transparent);
    color: var(--network-color, var(--dima-primary));
    font-size: 22px;
    transition: all 0.3s ease;
}

.dima-share-btn:hover .dima-btn-icon {
    background: var(--network-color, var(--dima-primary));
    color: white;
    transform: scale(1.1);
}

.dima-btn-label {
    font-size: 12px;
    font-weight: bold;
    color: var(--dima-text-muted);
    transition: color 0.3s ease;
}

.dima-share-btn:hover .dima-btn-label {
    color: var(--network-color, var(--dima-primary));
}

/* رنگ‌های خاص برای شبکه‌ها */
.dima-network-telegram { --network-color: #0088cc; }
.dima-network-whatsapp { --network-color: #25D366; }
.dima-network-twitter { --network-color: #ffffff; }
.dima-network-linkedin { --network-color: #0A66C2; }
.dima-network-facebook { --network-color: #1877F2; }
.dima-network-copy { --network-color: #fbbf24; }

/* ═══════════ بخش اضافی ═══════════ */
.dima-share-extra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--dima-border);
    position: relative;
    z-index: 1;
}

.dima-share-extra button,
.dima-share-extra a {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--dima-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
    font-family: inherit;
    text-decoration: none;
}

.dima-share-extra button:hover,
.dima-share-extra a:hover {
    color: var(--dima-primary-light);
}

.dima-share-extra i {
    font-size: 16px;
}

.dima-divider {
    color: var(--dima-border);
}

/* ═══════════ Toast ═══════════ */
.dima-share-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.dima-share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.dima-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--dima-bg);
    border: 1px solid var(--dima-border);
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: var(--dima-shadow);
    backdrop-filter: blur(20px);
}

.dima-toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(16,185,129,0.2);
    color: #10b981;
    font-size: 20px;
}

.dima-toast-icon.error {
    background: rgba(239,68,68,0.2);
    color: #ef4444;
}

.dima-toast-icon.info {
    background: rgba(59,130,246,0.2);
    color: #3b82f6;
}

.dima-toast-title {
    font-weight: bold;
    font-size: 14px;
    color: var(--dima-text);
    margin: 0;
}

.dima-toast-message {
    font-size: 12px;
    color: var(--dima-text-muted);
    margin: 4px 0 0;
}

/* ═══════════ انیمیشن موفقیت ═══════════ */
@keyframes dimaSuccessPulse {
    0% { box-shadow: 0 0 0 0 rgba(251,191,36,0.4); }
    70% { box-shadow: 0 0 0 15px rgba(251,191,36,0); }
    100% { box-shadow: 0 0 0 0 rgba(251,191,36,0); }
}

.dima-share-btn.copy-success {
    animation: dimaSuccessPulse 0.6s ease;
}

/* ═══════════ ریسپانسیو ═══════════ */
@media (max-width: 576px) {
    .dima-share-container {
        padding: 24px 16px;
    }

    .dima-share-title {
        font-size: 20px;
    }

    .dima-share-extra {
        flex-direction: column;
        gap: 16px;
    }

    .dima-divider {
        display: none;
    }
}

/* ═══════════ حالت چاپ ═══════════ */
@media print {
    .dima-share-section,
    .dima-share-toast {
        display: none !important;
    }
}
