/* Chat Icon Styles */
.chat-icon {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    transition: transform .2s;
    z-index: 9999;
    color: #fff
}

.chat-icon img {
    width: 24px;
    height: 24px
}

.chat-icon img[src$=".svg"] {
    filter: brightness(0) invert(1)
}

.chat-icon:hover {
    transform: translateY(-2px)
}

/* Welcome Message Styles */
.chatyar-welcome-message {
    position: fixed;
    padding: 10px 14px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    font-size: 13px;
    line-height: 1.5;
    z-index: 9998;
    opacity: 0;
    transform: scale(.8);
    transition: opacity .3s, transform .3s;
    pointer-events: none;
    max-width: 220px;
    cursor: pointer
}

.chatyar-welcome-message.show {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    animation: welcomeBounce .5s ease
}

@keyframes welcomeBounce {
    0% {
        transform: scale(.8)
    }

    50% {
        transform: scale(1.05)
    }

    100% {
        transform: scale(1)
    }
}

.chatyar-welcome-message::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid
}

/* برای چپ */
.chatyar-welcome-message.position-left::before {
    left: -6px;
    bottom: 14px;
    border-width: 6px 8px 6px 0;
}

/* برای راست */
.chatyar-welcome-message.position-right::before {
    right: -6px;
    bottom: 14px;
    border-width: 6px 0 6px 8px;
}

/* Chat Box Styles */
.chat-box {
    position: fixed;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    width: 400px;
    max-width: calc(100vw - 56px)
}

.chat-box.active {
    display: flex;
    animation: slideUp .2s ease
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* Chat Header Styles */
.chat-header {
    color: #fff;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.chat-header-content {
    flex: 1
}

.chat-header h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0
}

.chat-subtitle {
    font-size: 14px;
    margin: 4px 0 0;
    opacity: 0.9;
    font-weight: 600
}

.close-btn {
    background: rgba(255, 255, 255, .2);
    border: 0;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s
}

.close-btn:hover {
    background: rgba(255, 255, 255, .3)
}

/* Chat Content Styles */
.chat-content {
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
    background: #fff
}

.chat-content::-webkit-scrollbar {
    width: 4px
}

.chat-content::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px
}

/* Tab Navigation Styles */
.chat-box .chatyar-tabs {
    display: grid;
    background: #f5f5f5;
    padding: 4px;
    gap: 2px
}

.chat-box .chatyar-tab-btn {
    padding: 10px 6px;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s ease
}

.chat-box .chatyar-tab-btn:hover {
    color: #333;
    background: #eee
}

.chat-box .chatyar-tab-btn.active {
    background: #fff
}

/* Tab Content Styles */
.chat-box .chatyar-tab-content {
    display: none
}

.chat-box .tab-description {
    color: #666;
    font-size: 15px;
    margin-bottom: 12px;
    font-weight: 500;
    margin-top: 0
}

/* WhatsApp Tab Styles */
.chat-box .whatsapp-list {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.chat-box .whatsapp-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    text-decoration: none;
    transition: all .2s
}

.chat-box .whatsapp-item:hover {
    background: #f0fdf4;
    border-color: #86efac
}

.chat-box .whatsapp-profile {
    flex-shrink: 0;
}

.chat-box .whatsapp-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}

.chat-box .whatsapp-avatar-default {
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.chat-box .whatsapp-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.chat-box .whatsapp-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.3;
}

.chat-box .whatsapp-department {
    font-size: 12px;
    color: #666;
    line-height: 1.3;
}

.chat-box .whatsapp-icon {
    width: 32px;
    height: 32px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0
}

.chat-box .online-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1
}

.chat-box .online-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block
}

.chat-box .online-badge.online {
    background: #d1fae5;
    color: #065f46
}

.chat-box .online-badge.online::before {
    background: #10b981
}

.chat-box .online-badge.offline {
    background: #fee2e2;
    color: #991b1b
}

.chat-box .online-badge.offline::before {
    background: #ef4444
}


/* FAQ Tab Styles */
.chat-box .faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.chat-box .faq-item {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
    margin-bottom: 0 !important;
    padding: 0 !important
}

.chat-box .faq-question {
    width: 100%;
    padding: 8px 10px !important;
    background: 0;
    border: 0;
    text-align: right;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    transition: background .2s
}

.chat-box .faq-question::after {
    display: none !important
}

.chat-box .faq-question:hover {
    background: #f5f5f5
}

.chat-box .faq-icon {
    line-height: 0;
    font-size: 18px;
    font-weight: 700;
    transition: transform .2s
}

.chat-box .faq-item.active .faq-icon {
    transform: rotate(45deg)
}

.chat-box .faq-answer {
    padding: 0 14px;
    max-height: 0;
    overflow: hidden;
    transition: all .3s;
    font-size: 12px;
    line-height: 1.6;
    color: #555
}

.chat-box .faq-item.active .faq-answer {
    padding: 0 14px 12px;
    max-height: 400px
}

/* Contact Tab Styles */
.chat-box .contact-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px
}

.chat-box .contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    text-decoration: none;
    transition: all .2s
}

.chat-box .contact-item:hover {
    background: #fff
}

.chat-box .contact-icon {
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.chat-box .contact-info {
    display: flex;
    flex-direction: column;
    gap: 2px
}

.chat-box .contact-title {
    font-size: 12px;
    font-weight: 600;
    color: #333
}

.chat-box .contact-detail {
    font-size: 14px;
    color: #666
}

/* Working Hours Notice */
.chat-box .working-hours-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
    background: #f9fafb;
    border-radius: 8px;
    min-height: 200px
}

.chat-box .working-hours-notice svg {
    color: #9ca3af
}

.chat-box .chatyar-working-hours-list {
    width: 100%;
    max-width: 280px;
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1)
}

.chat-box .chatyar-wh-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0
}

.chat-box .chatyar-wh-item:last-child {
    border-bottom: none
}

.chat-box .chatyar-wh-days {
    font-size: 13px;
    font-weight: 600;
    color: #333
}

.chat-box .chatyar-wh-time {
    font-size: 12px;
    color: #666;
    direction: ltr;
    text-align: left
}

.chat-box .chatyar-wh-closed .chatyar-wh-days {
    color: #999
}

.chat-box .chatyar-wh-closed .chatyar-wh-time {
    color: #e74c3c;
    font-weight: 600
}

/* Smart Status Messages */
.chat-box .chatyar-smart-message {
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.5;
}

.chat-box .chatyar-smart-message.warning {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    color: #92400e;
}

.chat-box .chatyar-smart-message.info {
    background: #dbeafe;
    border: 1px solid #60a5fa;
    color: #1e40af;
}

.chat-box .chatyar-smart-message.success {
    background: #d1fae5;
    border: 1px solid #34d399;
    color: #065f46;
}

/* Responsive Styles */
@media(max-width:480px) {
    .chat-box .contact-list {
        grid-template-columns: 1fr
    }

    /* Fullscreen mode for mobile */
    .chat-box.chat-box-fullscreen.active {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh;
        border-radius: 0;
        z-index: 99999;
    }

    .chat-box.chat-box-fullscreen .chat-content {
        max-height: calc(100vh - 70px);
        height: calc(100vh - 70px);
    }
}