/* استایل‌های اصلی ویجت چت واتساپ */
.wpwmc-widget {
    position: fixed;
    bottom: var(--wpwmc-position-desktop-y);
    right: var(--wpwmc-position-desktop-x);
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* دکمه اصلی */
.wpwmc-button {
    width: var(--wpwmc-button-size-desktop);
    height: var(--wpwmc-button-size-desktop);
    border-radius: 50%;
    background: var(--wpwmc-theme-color);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    padding: 0;
}

.wpwmc-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.wpwmc-button:active {
    transform: scale(0.95);
}

.wpwmc-button img {
    width: 65%;
    height: 65%;
    object-fit: contain;
}

/* افکت ریپل برای کلیک */
.wpwmc-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.wpwmc-button:active::before {
    width: 200%;
    height: 200%;
}

/* متن راهنما (Tooltip) */
.wpwmc-tooltip {
    position: absolute;
    bottom: calc(100% + 15px);
    right: 0;
    background: #fff;
    color: #333;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
}

.wpwmc-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    border: 8px solid transparent;
    border-top-color: #fff;
}

/* انیمیشن‌های مختلف برای tooltip */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes tada {
    0% { transform: scale(1) rotate(0deg); }
    10%, 20% { transform: scale(0.9) rotate(-3deg); }
    30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
    40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.wpwmc-tooltip.pulse {
    animation: pulse 2s infinite;
}

.wpwmc-tooltip.bounce {
    animation: bounce 2s infinite;
}

.wpwmc-tooltip.shake {
    animation: shake 2s infinite;
}

.wpwmc-tooltip.tada {
    animation: tada 3s infinite;
}

/* پاپ‌آپ اکانت‌ها */
.wpwmc-popup {
    position: absolute;
    bottom: calc(100% + 20px);
    right: 0;
    width: 360px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 500px;
    display: flex;
    flex-direction: column;
}

.wpwmc-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* هدر پاپ‌آپ */
.wpwmc-popup-header {
    background: linear-gradient(135deg, var(--wpwmc-theme-color) 0%, #128c7e 100%);
    color: #fff;
    padding: 25px;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.wpwmc-popup-header h3 {
    margin: 0 0 5px 0;
    font-size: 20px;
    font-weight: 600;
}

.wpwmc-popup-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.wpwmc-close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.wpwmc-close-popup:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* کانتینر اکانت‌ها */
.wpwmc-agents-container {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* آیتم اکانت */
.wpwmc-agent-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
    border: 2px solid transparent;
}

.wpwmc-agent-item:hover {
    background: #e8f5e9;
    border-color: var(--wpwmc-theme-color);
    transform: translateX(-5px);
}

.wpwmc-agent-item:last-child {
    margin-bottom: 0;
}

/* تصویر پروفایل اکانت */
.wpwmc-agent-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-left: 15px;
    object-fit: cover;
    border: 3px solid var(--wpwmc-theme-color);
}

/* اطلاعات اکانت */
.wpwmc-agent-info {
    flex: 1;
}

.wpwmc-agent-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

.wpwmc-agent-description {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* نشانگر آنلاین */
.wpwmc-online-indicator {
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* آیکون فلش */
.wpwmc-agent-arrow {
    color: var(--wpwmc-theme-color);
    font-size: 20px;
    margin-right: 10px;
}

/* حالت خالی */
.wpwmc-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.wpwmc-empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* لودینگ */
.wpwmc-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.wpwmc-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--wpwmc-theme-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ریسپانسیو برای موبایل */
@media (max-width: 768px) {
    .wpwmc-widget {
        bottom: var(--wpwmc-position-mobile-y);
        right: var(--wpwmc-position-mobile-x);
    }
    
    .wpwmc-button {
        width: var(--wpwmc-button-size-mobile);
        height: var(--wpwmc-button-size-mobile);
    }
    
    .wpwmc-popup {
        width: calc(100vw - 30px);
        max-width: 360px;
        bottom: calc(100% + 10px);
        right: 50%;
        transform: translateX(50%) translateY(20px) scale(0.9);
    }
    
    .wpwmc-popup.active {
        transform: translateX(50%) translateY(0) scale(1);
    }
    
    .wpwmc-tooltip {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* انیمیشن ورودی */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wpwmc-agent-item {
    animation: slideInUp 0.4s ease-out forwards;
    opacity: 0;
}

.wpwmc-agent-item:nth-child(1) { animation-delay: 0.1s; }
.wpwmc-agent-item:nth-child(2) { animation-delay: 0.2s; }
.wpwmc-agent-item:nth-child(3) { animation-delay: 0.3s; }
.wpwmc-agent-item:nth-child(4) { animation-delay: 0.4s; }
.wpwmc-agent-item:nth-child(5) { animation-delay: 0.5s; }

/* حالت تاریک برای پاپ‌آپ */
@media (prefers-color-scheme: dark) {
    .wpwmc-popup {
        background: #1a1a1a;
        color: #fff;
    }
    
    .wpwmc-agent-item {
        background: #2a2a2a;
    }
    
    .wpwmc-agent-item:hover {
        background: #3a3a3a;
    }
    
    .wpwmc-agent-name {
        color: #fff;
    }
    
    .wpwmc-agent-description {
        color: #aaa;
    }
}

/* افکت‌های هاور خلاقانه */
.wpwmc-button {
    position: relative;
    overflow: hidden;
}

.wpwmc-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s;
}

.wpwmc-button:hover::after {
    transform: translate(-50%, -50%) scale(2);
}
/* Override CSS برای رفع تداخل با قالب‌ها */

/* ریست استایل‌های دکمه واتساپ */
.wpwmc-widget .wpwmc-button,
.wpwmc-widget .wpwmc-button:hover,
.wpwmc-widget .wpwmc-button:focus,
.wpwmc-widget .wpwmc-button:active {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* فقط تصویر دکمه */
.wpwmc-widget .wpwmc-button img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* اگر می‌خواهید سایه روی تصویر باشد */
.wpwmc-widget .wpwmc-button img {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    transition: all 0.3s ease;
}

.wpwmc-widget .wpwmc-button:hover img {
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.25));
}

/* حذف استایل‌های اضافی از ویجت */
.wpwmc-widget,
.wpwmc-widget * {
    font-family: inherit !important;
}

/* تنظیمات مودال ادمین برای جلوگیری از overflow */
.wpwmc-modal {
    padding: 20px;
}

.wpwmc-modal-content {
    max-height: calc(100vh - 40px) !important;
    overflow-y: auto !important;
    margin: 20px auto !important;
}

/* اسکرول برای بخش ساعات کاری */
.working-hours-container {
    max-height: 200px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* تنظیم عرض فیلدهای ساعت */
.working-hour-row {
    display: grid !important;
    grid-template-columns: 120px 80px 30px 80px !important;
    gap: 10px !important;
    align-items: center !important;
    padding: 5px !important;
}

.working-hour-row label {
    margin: 0 !important;
}

/* دکمه‌های مودال */
.wpwmc-form-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 20px 0 0 0;
    margin-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* برای موبایل */
@media (max-width: 768px) {
    .wpwmc-modal-content {
        width: 95% !important;
        margin: 10px auto !important;
        padding: 20px !important;
    }
    
    .working-hour-row {
        grid-template-columns: 1fr !important;
        gap: 5px !important;
    }
    
    .working-hour-row input[type="time"] {
        width: 100% !important;
    }
}