/* ===============================
   MRWallpost Internal Network
   Astra + Elementor Safe CSS
   =============================== */

/* جلوگیری از اسکرول افقی */
html, body {
    overflow-x: hidden;
}

/* ===============================
   TABLE WRAPPER
   =============================== */

.internal-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
        border-radius: 10px;
}
@media (max-width: 769px) {
    .internal-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
        
    }
}
/* ===============================
   DESKTOP TABLE
   =============================== */

.internal-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
}

.internal-table-wrap th,
.internal-table-wrap td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
    word-break: break-word;
}

.internal-table-wrap th {
    font-weight: 700;
    background: #f8f9fb;
}

/* Thumbnail */
.internal-table-wrap .private-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .2s ease;
}

.internal-table-wrap .private-thumb:hover {
    transform: scale(1.05);
}

/* ===============================
   TABS
   =============================== */

.internal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.internal-tabs button {
    flex: 1;
    padding: 10px;
    border-radius: 14px;
    border: none;
    background: #747474;
    font-weight: 600;
    cursor: pointer;
}

.internal-tabs button.active {
    background: #2271b1;
    color: #fff;
    font-weight: bold;
}

/* badge */
.tab-badge {
    display: inline-block;
    min-width: 22px;
    padding: 2px 7px;
    margin-right: 6px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 12px;
    color: #fff;
}

.badge-unread { background: #e53935; }
.badge-archived { background: #9e9e9e; }

.internal-tabs button.active .tab-badge {
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

/* ===============================
   TAB CONTENT
   =============================== */

.internal-tab-content { display: none; margin-top: 15px; }
.internal-tab-content.active { display: block; }

/* ===============================
   DESKTOP ROW STRIPES
   =============================== */

@media (min-width: 769px) {
    .internal-table-wrap table tr:nth-child(even) {
        background: #f7f7f7;
    }
}




/* ===============================
   MOBILE CARD VIEW (Clean WhatsApp Style)
   =============================== */
/* انیمیشن slide-in */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}




@media (max-width: 768px) {
.internal-table-wrap tr:nth-child(1) { animation-delay: .05s; }
    .internal-table-wrap tr:nth-child(2) { animation-delay: .1s; }
    .internal-table-wrap tr:nth-child(3) { animation-delay: .15s; }
    .internal-table-wrap tr:nth-child(4) { animation-delay: .2s; }
    .internal-table-wrap table,
    .internal-table-wrap thead,
    .internal-table-wrap tbody,
    .internal-table-wrap tr,
    .internal-table-wrap td {
        display: block;
        width: 100%;
        border: none;
    }

    .internal-table-wrap thead {
        display: none;
    }

    /* CARD */
    .internal-table-wrap tr {
        animation: slideInRight 0.35s ease-out both;
        position: relative;
        background: #2271b1;
        margin-bottom: 14px;
        padding: 14px 14px 34px; /* فضا برای فوتر */
        border-radius: 18px 18px 4px 18px;
        box-shadow: 0 4px 10px rgba(0,0,0,.08);
        border: 1px solid #e2e8f0;
    }
 

    /* TITLE – top right */
    .internal-table-wrap td[data-label="عنوان"] {
        font-size: 13px;
        font-weight: 400;
        color: #ffffff;
        text-align: right;
        padding: 0 0 6px;
    }

    /* DESCRIPTION – main focus */
    .internal-table-wrap td[data-label="توضیح"] {
        padding: 12px 14px;
        border-radius: 14px;
        margin: 8px 0;
        font-size: 16px;
        line-height: 2;
        color: #ffffff;
        text-align: center;
        font-weight: 600;
     text-align: justify;
    }

    

    .internal-table-wrap .private-thumb {
        width: 100%;
        max-width: 220px;
        border-radius: 12px;
        margin-top: 6px;
    }

    /* FOOTER */
    .internal-table-wrap td[data-label="ارسال‌کننده"] {
        position: absolute;
        bottom: 8px;
        right: 14px;
        font-size: 13px;
        font-weight: 400;
        color: #ffffff;
        padding: 0;
        text-align: right;
        width: auto;
    }

    .internal-table-wrap td[data-label="تاریخ"],
    .internal-table-wrap td[data-label="تاریخ ارسال"] {
        position: absolute;
        bottom: 8px;
        left: 14px;
        font-size: 13px;
        font-weight: 400;
        color: #ffffff;
        padding: 0;
        text-align: left;
        width: auto;
    }

    /* remove mobile labels */
    .internal-table-wrap td::before {
        display: none;
    }
     /* FILE BUBBLE */
    .internal-table-wrap td[data-label="فایل"] {
        background: #eef2ff;
        border: 1px solid #c7d2fe;
        padding: 12px 14px;
        border-radius: 16px;
        margin: 6px 0 10px;
        position: relative;
        font-size: 14px;
    }

    /* FILE ICON */
    .internal-table-wrap td[data-label="فایل"]::before {
        content: "📎 فایل پیوست";
        display: block;
        font-size: 12px;
        color: #4338ca;
        margin-bottom: 6px;
        font-weight: 600;
    }

    /* FILE LINKS */
    .internal-table-wrap td[data-label="فایل"] a {
        display: inline-block;
        background: #ffffff;
        padding: 8px 12px;
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        font-size: 13px;
        color: #1e40af;
        text-decoration: none;
        margin-top: 4px;
    }

    .internal-table-wrap td[data-label="فایل"] a:hover {
        background: #e0e7ff;
    }

    /* IMAGE FILE */
    .internal-table-wrap .private-thumb {
        display: block;
        margin-top: 8px;
        border-radius: 14px;
        max-width: 100%;
    }
    /* HIDE EMPTY FILE CELL */
    .internal-table-wrap td[data-label="فایل"]:empty {
        display: none;
    }

    /* اگر داخلش فقط space یا br بود */
    .internal-table-wrap td[data-label="فایل"]:not(:has(img)):not(:has(a)) {
        display: none;
    }
    

}



/* ===============================
   IMAGE MODAL
   =============================== */

#image-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: .25s;
}

#image-modal.show {
    opacity: 1;
    pointer-events: auto;
}

#image-modal img {
    max-width: 94%;
    max-height: 94%;
    border-radius: 16px;
}

/* ===============================
   ARCHIVE FILTER UI
   =============================== */

.archive-filter-wrap {
    background: #f8fafc;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-bottom: 10px;
    display: block;
}

.archive-filter-wrap .filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.archive-filter-wrap select,
.archive-filter-wrap input[type="date"], .archive-filter-wrap input[type="text"] {
    border-radius: 12px;
    border: 1px solid #ccc;
    background: #f9f9f9;
    font-size: 14px;
    transition: .2s;
}

.archive-filter-wrap select:hover,
.archive-filter-wrap input[type="date"]:hover,
.archive-filter-wrap input[type="text"]:hover,
.archive-filter-wrap select:focus,
.archive-filter-wrap input[type="date"]:focus, .archive-filter-wrap input[type="text"]:focus {
    border-color: #2271b1;
    box-shadow: 0 0 6px rgba(34,113,177,.3);
    background: #fff;
    outline: none;
}

.archive-filter-wrap label {
    font-size: 13px;
    color: #475569;
    white-space: nowrap;
}

/* admin compact */
.archive-filter-wrap.is-admin select,
.archive-filter-wrap.is-admin input[type="date"] {
    min-width: 20%;
    font-size: 13px;
}

/* actions */
.archive-filter-wrap .filter-actions {
    margin-top: 12px;
    text-align: left;
}

.archive-filter-wrap .apply-filters {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
}

.archive-filter-wrap .apply-filters:hover {
    background: #1e40af;
}

/* mobile filters */
@media (max-width: 768px) {
    .archive-filter-wrap .filter-row {
        flex-wrap: wrap;
    }

    .archive-filter-wrap select,
    .archive-filter-wrap input[type="date"] {
        width: 100%;
    }
    #select-all-wrapper {
        display: block;
        margin-bottom: 10px;
    }
    #select-all-messages {
        margin-right: 5px;
    }
    #internal-network-form + .apply-filters,
.apply-filters {
    margin-bottom: 50px; /* فاصله از پایین صفحه */
    display: inline-block;
    padding: 10px 20px; /* بزرگ‌تر کردن کلیک‌پذیری */
    border-radius: 6px;
    background: #0073e6;
    color: #fff;
    border: none;
    cursor: pointer;
    max-width:55%;
}
    button#voice-record-btn, .custom-file-upload {

    max-width: 100% !important; /* اندازه دلخواه */
}

}

@media (min-width: 769px) {
    .internal-table-wrap table tbody tr {
        transition: background-color 0.2s ease;
    }

    .internal-table-wrap table tbody tr:hover {
                background-color: #2271b1;
        color: #ffffff;
    }

}

/* کانتینر فایل */
button#voice-record-btn, .custom-file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 300px; /* اندازه دلخواه */
    background: #2271b1;
    color: #fff;
    padding: 10px 15px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    transition: background .2s;
}

.custom-file-upload:hover {
    background: #045cb4;
}

/* input واقعی مخفی شود */
.custom-file-upload input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* متن فایل انتخاب شده */
.file-selected {
    margin-top: 6px;
    font-size: 13px;
    color: #333;
    display: inline-block;
    text-align: center;
    word-break: break-word;
}
/* چک‌باکس و لیبل انتخاب همه برای آرشیو */

/* دسکتاپ: فقط چک‌باکس و لیبل مخفی */
@media (min-width: 769px) {
    #select-all-messages-mobile,
    .mobile-select-all-wrapper label {
        display: none;
    }
}

/* موبایل: چک‌باکس و لیبل نمایش داده شوند */
@media (max-width: 768px) {
    #select-all-messages-mobile,
    .mobile-select-all-wrapper label {
display: inline-block;
        margin-right: 10px;
        font-size: 15px;
        max-width: 40%;
        margin-left: 5px;
        
    }
}

button.reset-filters {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
}
#voice-record-wrapper {
    display:flex;
    flex-direction: column;
    gap:5px;
    align-items: flex-start;
}
#voice-record-btn.recording {
    background-color:#e74c3c;
    color:#fff;
}
#voice-timer {
    font-weight:bold;
    margin-left:5px;
}
audio {
    width: 100%;
}
@media (max-width:600px){
    #voice-record-wrapper {
        width: 100%;
    }
    #voice-record-btn {
        width: 100%;
    }
}
.archive-pending {
    animation: archive-pulse 1s infinite;
    background-color: #fcb144; /* رنگ سازمانی */
    color: #ffffff !important; /* متن سفید */
    transition: background-color 0.5s, transform 0.3s;
}

@keyframes archive-pulse {
    0%   { background-color: #fcb144; transform: scale(1); }
    50%  { background-color: #ffb733; transform: scale(1.02); } /* کمی روشن‌تر */
    100% { background-color: #fcb144; transform: scale(1); }
}



