/* ریست و تنظیمات پایه */
#melli-sms-fab, #melli-sms-chatbox, #melli-sms-chatbox * {
    box-sizing: border-box;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    direction: rtl;
}

/* دکمه شناور با انیمیشن جذاب */
#melli-sms-fab {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #0c29b5, #00a862);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.4);
    z-index: 9998;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: melli-pulse 2.5s infinite;
}

@keyframes melli-pulse {
    0% { box-shadow: 0 8px 25px rgba(245, 87, 108, 0.4), 0 0 0 0 rgba(245, 87, 108, 0.6); }
    70% { box-shadow: 0 8px 25px rgba(245, 87, 108, 0.4), 0 0 0 20px rgba(245, 87, 108, 0); }
    100% { box-shadow: 0 8px 25px rgba(245, 87, 108, 0.4), 0 0 0 0 rgba(245, 87, 108, 0); }
}

#melli-sms-fab:hover {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 12px 35px rgba(245, 87, 108, 0.6);
    animation: none;
}

/* پنجره چت با طراحی مدرن */
#melli-sms-chatbox {
    position: fixed;
    bottom: 110px;
    left: 30px;
    width: 400px;
    max-height: 600px;
    background: linear-gradient(180deg, #fff 0%, #fef9ff 100%);
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 1px solid rgba(255, 107, 157, 0.1);
}

#melli-sms-chatbox.melli-hidden {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    pointer-events: none;
}

/* هدر با گرادینت زیبا */
.melli-header {
    background: linear-gradient(135deg, #0c29b5 0%, #00a862 50%, #ff9933 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    width:100%;
}

.melli-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: melli-shine 8s linear infinite;
}

@keyframes melli-shine {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.melli-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.melli-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.melli-header-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.melli-header-title span {
    font-size: 11px;
    opacity: 0.95;
    display: block;
    margin-top: 3px;
}

.melli-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    margin-top: 4px;
}

.melli-status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 8px #4ade80;
    animation: melli-blink 1.5s infinite;
}

@keyframes melli-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#melli-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

#melli-close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg);
}

/* بدنه چت */
.melli-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(180deg, #fef9ff 0%, #fff 100%);
    scroll-behavior: smooth;
}

.melli-body::-webkit-scrollbar {
    width: 6px;
}

.melli-body::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
}

.melli-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #0c29b5, #ff9933);
    border-radius: 10px;
}

/* پیام‌های بات با طراحی صمیمی */
.melli-message {
    padding: 14px 18px;
    border-radius: 18px;
    margin-bottom: 15px;
    font-size: 13.5px;
    line-height: 1.8;
    max-width: 90%;
    animation: melli-slideIn 0.5s ease-out;
    position: relative;
}

@keyframes melli-slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.melli-bot-msg {
    background: linear-gradient(135deg, #fff0f5 0%, #ffe4ec 100%);
    color: #4a4a4a;
    border-bottom-right-radius: 5px;
    align-self: flex-start;
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.1);
    border: 1px solid rgba(255, 107, 157, 0.15);
}

.melli-bot-msg strong {
    color: #ff9933;
}

/* ناحیه انتخاب شغل */
.melli-input-area {
    margin-bottom: 20px;
    position: relative;
}

.melli-input-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    font-weight: 500;
}

#melli-job-select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #ffe4ec;
    border-radius: 15px;
    font-size: 13.5px;
    background: white;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
    font-family: inherit;
    color: #4a4a4a;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f5576c'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 15px center;
    background-size: 20px;
    padding-left: 40px;
}

#melli-job-select:hover {
    border-color: #0c29b5;
}

#melli-job-select:focus {
    border-color: #ff9933;
    box-shadow: 0 0 0 4px rgba(245, 87, 108, 0.1);
}

/* جستجو و شمارنده */
.melli-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    background: white;
    padding: 10px 15px;
    border-radius: 15px;
    border: 2px solid #ffe4ec;
    transition: all 0.3s;
}

.melli-search-box:focus-within {
    border-color: #0c29b5;
    box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.1);
}

#melli-search {
    flex: 1;
    border: none;
    outline: none;
    font-size: 13px;
    padding: 5px;
    font-family: inherit;
    background: transparent;
}

.melli-count {
    font-size: 11px;
    color: #ff9933;
    font-weight: 700;
    white-space: nowrap;
    background: linear-gradient(135deg, #fff0f5, #ffe4ec);
    padding: 4px 10px;
    border-radius: 20px;
}

/* کارت‌های پیامک با طراحی زیبا */
.melli-template-card {
    background: white;
    border: 1px solid #ffe4ec;
    border-radius: 18px;
    padding: 15px;
    margin-bottom: 12px;
    position: relative;
    box-shadow: 0 3px 12px rgba(255, 107, 157, 0.08);
    transition: all 0.3s;
    animation: melli-slideIn 0.5s ease-out;
}

.melli-template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 157, 0.15);
    border-color: #0c29b5;
}

.melli-template-num {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #0c29b5, #ff9933);
    color: white;
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(245, 87, 108, 0.3);
}

.melli-template-card p {
    margin: 0 0 35px 0;
    font-size: 12.5px;
    color: #4a4a4a;
    line-height: 1.9;
    text-align: justify;
    padding-right: 5px;
}

.melli-copy-btn {
    background: linear-gradient(135deg, #0c29b5, #ff9933);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 11.5px;
    cursor: pointer;
    position: absolute;
    bottom: 12px;
    left: 12px;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(245, 87, 108, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.melli-copy-btn::before {
    content: '📋';
    font-size: 12px;
}

.melli-copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.melli-copy-btn.copied {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    box-shadow: 0 3px 10px rgba(34, 197, 94, 0.3);
}

.melli-copy-btn.copied::before {
    content: '✓';
}

/* صفحه‌بندی */
#melli-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 15px;
    padding: 10px 0;
}

.melli-page-btn {
    background: white;
    border: 2px solid #ffe4ec;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
    color: #ff9933;
    font-family: inherit;
}

.melli-page-btn:hover {
    background: #fff0f5;
    border-color: #0c29b5;
    transform: scale(1.1);
}

.melli-page-btn.active {
    background: linear-gradient(135deg, #0c29b5, #ff9933);
    color: white;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(245, 87, 108, 0.3);
}

/* فوتر */
.melli-footer {
    padding: 12px;
    text-align: center;
    font-size: 11px;
    color: #888;
    background: linear-gradient(180deg, #fff 0%, #fef9ff 100%);
    border-top: 1px solid #ffe4ec;
}

.melli-footer strong {
    background: linear-gradient(135deg, #0c29b5, #ff9933);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* ریسپانسیو */
@media (max-width: 480px) {
    #melli-sms-chatbox {
        width: calc(100% - 20px);
        left: 10px;
        right: 10px;
        bottom: 95px;
        max-height: 75vh;
    }
    #melli-sms-fab {
        bottom: 20px;
        left: 20px;
        width: 58px;
        height: 58px;
    }
}

