/* ===============================
   استایل اصلی ویجت - RESET
   =============================== */
.custom-content-box {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: transparent;
    direction: rtl;
    gap: 0;
    cursor: pointer;
    z-index: auto !important;
}

/* -------------------------------
   بخش اصلی - RESET
   ------------------------------- */
.main-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px 0 0 8px;
    border-right: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    
    /* RESET - حذف تمام اندازه‌های ثابت */
    /* width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    padding: 0 !important; */
}

.main-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px !important;
}

/* -------------------------------
   بخش کناری - RESET
   ------------------------------- */
.side-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #007cba;
    border: 1px solid #007cba;
    border-radius: 0 8px 8px 0;
    transition: all 0.3s ease;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    
    /* RESET - حذف تمام اندازه‌های ثابت */
    /* width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    padding: 0 !important; */
}

.side-text {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px !important;
}

/* ===============================
   پنل هاور در دسکتاپ
   =============================== */
.hover-panel {
    position: absolute;
    top: 100%;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 10px;
    min-width: 300px;
    box-sizing: border-box;
    cursor: auto;
}

/* موقعیت‌ها در دسکتاپ */
.custom-content-box[data-hover-position="right"] .hover-panel { right: 0; }
.custom-content-box[data-hover-position="left"] .hover-panel { left: 0; right: auto; }
.custom-content-box[data-hover-position="center"] .hover-panel {
    right: 50%;
    transform: translateX(50%) translateY(-10px);
}

/* نمایش در دسکتاپ */
.custom-content-box.hover-active .hover-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-content-box[data-hover-position="center"].hover-active .hover-panel {
    transform: translateX(50%) translateY(0);
}

/* -------------------------------
   متن و عنوان داخل پنل
   ------------------------------- */
.hover-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

.hover-content {
    padding: 20px;
    line-height: 1.6;
    color: #555;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ===============================
   ریسپانسیو تبلت (768px تا 1024px)
   =============================== */
@media (min-width: 768px) and (max-width: 1024px) {
    .custom-content-box {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .main-section,
    .side-section {
        text-align: center;
        justify-content: center;
        
        /* حذف تمام محدودیت‌های عرض در تبلت */
        width: auto !important;
        min-width: auto !important;
        max-width: none !important;
        flex: none !important;
    }

    .main-text,
    .side-text {
        font-size: 14px;
        white-space: normal;
        overflow: visible;
    }

    .main-icon,
    .side-icon {
        font-size: 18px !important;
    }

    /* پاپ‌آپ تبلت */
    .hover-panel {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        width: 90% !important;
        max-width: 430px;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 999999 !important;
        background: white;
        border: 2px solid #007cba;
        border-radius: 14px;
        box-shadow: 0 25px 65px rgba(0,0,0,0.35);
        transform: translate(-50%, -50%) !important;
        opacity: 0;
        visibility: hidden;
    }

    .custom-content-box.mobile-active .hover-panel {
        opacity: 1 !important;
        visibility: visible !important;
        animation: softPopUp 0.35s cubic-bezier(.25,.46,.45,.94) forwards;
    }

    /* جلوگیری از تداخل RTL */
    .custom-content-box[data-hover-position] .hover-panel {
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
    }

    /* Overlay */
    .custom-content-box-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        z-index: 999998;
    }

    .custom-content-box-overlay.active {
        display: block;
    }
}

/* ===============================
   ریسپانسیو موبایل (تا 767px)
   =============================== */
@media (max-width: 767px) {
    .custom-content-box {
        width: 100%;
        display: flex;
        justify-content: center;
        flex-wrap: nowrap;
    }

    .main-section,
    .side-section {
        text-align: center;
        justify-content: center;
        
        /* حذف تمام محدودیت‌های عرض در موبایل */
        width: auto !important;
        min-width: auto !important;
        max-width: none !important;
        flex: none !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .main-text,
    .side-text {
        font-size: 13px;
        line-height: 1.3;
        white-space: normal;
        overflow: visible;
        word-break: break-word;
    }

    .main-icon,
    .side-icon {
        font-size: 16px !important;
    }

    /* پاپ‌آپ موبایل */
    .hover-panel {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        width: 90% !important;
        max-width: 430px;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 999999 !important;
        background: white;
        border: 2px solid #007cba;
        border-radius: 14px;
        box-shadow: 0 25px 65px rgba(0,0,0,0.35);
        transform: translate(-50%, -50%) !important;
        opacity: 0;
        visibility: hidden;
    }

    .custom-content-box.mobile-active .hover-panel {
        opacity: 1 !important;
        visibility: visible !important;
        animation: softPopUp 0.35s cubic-bezier(.25,.46,.45,.94) forwards;
    }

    /* جلوگیری از تداخل RTL */
    .custom-content-box[data-hover-position] .hover-panel {
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
    }

    /* Overlay */
    .custom-content-box-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        z-index: 999998;
    }

    .custom-content-box-overlay.active {
        display: block;
    }
}

/* ===============================
   انیمیشن جدید و جذاب Soft Pop-Up
   =============================== */
@keyframes softPopUp {
    0% {
        transform: translate(-50%, -40%) scale(0.85);
        opacity: 0;
    }
    60% {
        transform: translate(-50%, -48%) scale(1.03);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* ===============================
   استایل‌های اضافه برای تنظیمات ابعاد
   =============================== */
@media (min-width: 1025px) {
    .main-section,
    .side-section {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* تنظیمات نمایش محتوا در بخش‌ها */
.main-section,
.side-section {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
}

/* برای نمایش بهتر در حالت‌های مختلف */
@media (max-width: 767px) {
    .main-section,
    .side-section {
        flex-direction: column;
        gap: 4px !important;
    }
    
    .main-icon,
    .side-icon {
        margin-bottom: 2px;
    }
}