/* ==========================================================================
   IKCO Panel - استایل پنل کاربری اختصاصی
   نسخه اصلاح‌شده: حذف تکرارها، تبدیل Emoji به SVG، اصلاح Grid
   ========================================================================== */

/* ============================================= */
/* ۱. حذف متن‌های پیش‌فرض ووکامرس                */
/* ============================================= */
.woocommerce-MyAccount-content > p:not(.welcome-message) {
    display: none !important;
}

/* ============================================= */
/* ۲. داشبورد اصلی (باکس‌های آماری)              */
/* ============================================= */
.ikco-dashboard {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 25px;
}

.dashboard-box {
    flex: 1 1 150px;
    background: #ffffff;
    border-radius: 16px;
    padding: 25px 22px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.dashboard-box:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15);
}

.dashboard-icon {
    font-size: 32px;
    margin-left: 18px;
    line-height: 1;
}

.dashboard-info span {
    display: block;
    font-size: 14px;
    color: #777;
}

.dashboard-info strong {
    display: block;
    font-size: 18px;
    margin-top: 6px;
    color: #222;
}

.welcome-message {
    font-size: 18px;
    margin-bottom: 18px;
}

/* باکس‌های لینک‌دار داشبورد */
.dashboard-box.dashboard-link {
    display: flex;
    width: 100%;
    background: #ffffff;
    border-radius: 16px;
    padding: 25px 22px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    align-items: center;
}

.dashboard-box.dashboard-link:hover {
    background: #ffffff;
    transform: translateY(-6px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15);
}

.dashboard-box.dashboard-link,
.dashboard-box.dashboard-link:hover,
.dashboard-box.dashboard-link:focus,
.dashboard-box.dashboard-link:active {
    text-decoration: none;
    color: inherit;
}

/* ============================================= */
/* ۳. منوی حساب کاربری (آیکون‌های SVG)          */
/* ============================================= */

/* --- دسکتاپ: چیدمان Grid --- */
.ikco-account-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.ikco-nav-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.ikco-nav-box:hover {
    background: #f5faff;
    border-color: #b8daff;
}

.ikco-nav-box.ikco-active {
    background: #e3f2ff;
    border-color: #50aaff;
}

/* --- آیکون SVG --- */
.ikco-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ikco-nav-icon svg {
    width: 24px;
    height: 24px;
    display: block;
    stroke: #555;
    transition: all 0.3s ease;
}

.ikco-nav-box.ikco-active .ikco-nav-icon svg,
.ikco-nav-box:hover .ikco-nav-icon svg {
    stroke: #007cba;
    transform: scale(1.1);
}

/* --- متن منو --- */
.ikco-nav-label {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    display: block;
}

.ikco-nav-box.ikco-active .ikco-nav-label {
    color: #007cba;
    font-weight: bold;
}

/* --- موبایل: اسکرول افقی --- */
@media (max-width: 768px) {
    .ikco-account-boxes {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        gap: 12px !important;
        margin-bottom: 20px !important;
        padding-bottom: 10px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin !important;
    }

    .ikco-account-boxes::-webkit-scrollbar {
        height: 4px;
    }

    .ikco-account-boxes::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .ikco-account-boxes::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 10px;
    }

    .ikco-nav-box {
        flex-shrink: 0 !important;
        padding: 5px 8px !important;
        gap: 8px !important;
        border-radius: 10px !important;
    }

    .ikco-nav-icon svg {
        width: 18px !important;
        height: 18px !important;
    }

    .ikco-nav-label {
        font-size: 13px !important;
        font-weight: 500 !important;
        white-space: nowrap !important;
    }
}

/* ============================================= */
/* ۴. نظرات من                                   */
/* ============================================= */
.ikco-comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 25px;
}

.ikco-comment-box {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: 0.3s;
}

.ikco-comment-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.ikco-comment-box h4 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
}

.ikco-comment-box h4 a {
    color: #222;
    text-decoration: none;
}

.ikco-comment-rating {
    margin-bottom: 12px;
    color: #f5a623;
    font-size: 14px;
    font-weight: 600;
}

.ikco-comment-text {
    line-height: 2;
    color: #444;
    margin-bottom: 15px;
    font-size: 14px;
}

.ikco-comment-meta {
    font-size: 13px;
    color: #888;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
}

/* ============================================= */
/* ۵. نمایش آخرین سفارش‌ها در داشبورد           */
/* ============================================= */
.ikco-last-order-box {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 18px;
    padding: 22px;
    margin-top: 24px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

.ikco-last-order-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f3f5;
}

.ikco-last-order-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #222;
}

.ikco-order-item {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 18px;
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid #ececec;
    border-radius: 16px;
    background: #fff;
    transition: 0.25s;
}

.ikco-order-item:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

.ikco-last-order-meta {
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 14px;
    padding: 16px;
}

.ikco-meta-item {
    margin-bottom: 14px;
}

.ikco-meta-item:last-child {
    margin-bottom: 0;
}

.ikco-order-number {
    display: inline-block;
    background: #f8f9fa;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
    color: #444;
}

.ikco-meta-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}

/* --- نشان وضعیت سفارش --- */
.ikco-order-status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
}

.status-completed  { background: #e9f9ef; color: #1f9254; }
.status-processing { background: #fff7e6; color: #c98500; }
.status-on-hold    { background: #eef6ff; color: #1d6fb8; }
.status-refunded   { background: #f3f4f6; color: #555; }
.status-pending    { background: #eef2ff; color: #4f46e5; }
.status-cancelled,
.status-failed     { background: #fdecec; color: #d63638; }

/* --- کد رهگیری --- */
.ikco-tracking-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #fff;
    border: 1px dashed #d8d8d8;
    border-radius: 10px;
    padding: 10px;
}

.ikco-tracking-code {
    font-size: 14px;
    font-weight: 700;
    direction: ltr;
}

.ikco-tracking-link {
    text-decoration: none;
    color: #0d6efd;
    font-size: 13px;
    font-weight: 600;
}

/* --- محصولات سفارش (کاروسل افقی) --- */
.ikco-last-order-products-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.ikco-last-order-products {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #d1d1d1 #f1f1f1;
}

.ikco-last-order-products::-webkit-scrollbar {
    height: 6px;
}

.ikco-last-order-products::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.ikco-last-order-products::-webkit-scrollbar-thumb {
    background: #d1d1d1;
    border-radius: 10px;
}

.ikco-last-order-products::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.ikco-last-product {
    flex: 0 0 110px;
    width: 110px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 10px;
    text-align: center;
    background: #fff;
    transition: 0.2s;
}

.ikco-last-product:hover {
    transform: translateY(-3px);
    border-color: #ddd;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

.ikco-last-product-image img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    margin-bottom: 6px;
}

.ikco-last-product-name {
    font-size: 12px;
    color: #333;
    line-height: 1.6;
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ikco-last-product-qty {
    font-size: 11px;
    color: #777;
    margin-top: auto;
    padding-top: 6px;
}

@media (max-width: 768px) {
    .ikco-order-item {
        grid-template-columns: 1fr;
    }
}

/* ============================================= */
/* ۶. مخفی کردن بخش تغییر رمز در ویرایش حساب    */
/* ============================================= */
.woocommerce-EditAccountForm fieldset,
.woocommerce-EditAccountForm .woocommerce-form-row[class*="password"] {
    display: none !important;
}

/* ============================================= */
/* ۷. نوار پیشرفت گرافیکی وضعیت سفارش           */
/* ============================================= */
.ikco-progress {
    --ikco-p-reached: #1f9254;
    --ikco-p-todo: #f5c542;
    display: flex;
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
}

.ikco-progress-step {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.ikco-progress-step + .ikco-progress-step::before {
    content: "";
    position: absolute;
    top: 17px;
    inset-inline-start: -50%;
    width: 100%;
    height: 3px;
    background: var(--ikco-p-todo);
    z-index: 0;
}

.ikco-progress-step.is-done + .ikco-progress-step::before {
    background: var(--ikco-p-reached);
}

.ikco-progress-dot {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: #fff;
    border: 3px solid var(--ikco-p-todo);
    box-sizing: border-box;
}

.ikco-progress-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin: 0;
    padding: 0;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif;
    font-size: 16px;
    line-height: 1;
    letter-spacing: 0;
    text-indent: 0;
    text-align: center;
    overflow: visible;
}

.ikco-progress-step.is-done .ikco-progress-dot,
.ikco-progress-step.is-current .ikco-progress-dot {
    border-color: var(--ikco-p-reached);
    background: #eefaf3;
}

.ikco-progress-step.is-current .ikco-progress-dot {
    animation: ikco-progress-pulse 2s infinite;
}

.ikco-progress-label {
    font-size: 11.5px;
    line-height: 1.5;
    color: #999;
    font-weight: 600;
}

.ikco-progress-step.is-done .ikco-progress-label,
.ikco-progress-step.is-current .ikco-progress-label {
    color: var(--ikco-p-reached);
}

.ikco-progress-step.is-current .ikco-progress-label {
    font-weight: 800;
}

.ikco-progress-note {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 700;
}

@keyframes ikco-progress-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(31, 146, 84, 0.45); }
    70%  { box-shadow: 0 0 0 9px rgba(31, 146, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(31, 146, 84, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .ikco-progress-step.is-current .ikco-progress-dot {
        animation: none;
    }
}

/* ============================================= */
/* ۸. صفحه تیکت‌ها: تب‌ها، فرم و جدول            */
/* ============================================= */
.ikco-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 22px;
    padding: 6px;
    background: #f5f6f8;
    border-radius: 14px;
}

.ikco-tab {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #666;
    text-decoration: none;
    transition: 0.2s;
}

.ikco-tab:hover {
    color: #222;
}

.ikco-tab.is-active {
    background: #fff;
    color: #1f9254;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ikco-tab-count {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #444;
    font-size: 12px;
    text-align: center;
}

.ikco-tab.is-active .ikco-tab-count {
    background: #e9f9ef;
    color: #1f9254;
}

.ikco-tab-panel[hidden] {
    display: none;
}

/* --- فرم ثبت تیکت --- */
.ikco-ticket-form {
    max-width: 620px;
    padding: 22px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 16px;
}

.ikco-field {
    margin-bottom: 18px;
}

.ikco-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.ikco-field input[type="text"],
.ikco-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dcdfe4;
    border-radius: 10px;
    background: #fff;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ikco-field input[type="text"]:focus,
.ikco-field textarea:focus {
    outline: none;
    border-color: #1f9254;
    box-shadow: 0 0 0 3px rgba(31, 146, 84, 0.15);
}

.ikco-field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dcdfe4;
    border-radius: 10px;
    background: #fff;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ikco-field select:focus {
    outline: none;
    border-color: #1f9254;
    box-shadow: 0 0 0 3px rgba(31, 146, 84, 0.15);
}

.ikco-field[hidden] {
    display: none;
}

.ikco-field textarea {
    resize: vertical;
    min-height: 130px;
}

.ikco-field input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px dashed #cfd3d9;
    border-radius: 10px;
    background: #fafafa;
    box-sizing: border-box;
}

.ikco-field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    color: #888;
}

.ikco-ticket-submit {
    min-width: 140px;
    border-radius: 10px !important;
    background: #1567e1 !important;
    color: #fff !important;
}

/* --- جدول تیکت‌های من --- */
.ikco-ticket-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #ececec;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.ikco-ticket-table th {
    padding: 12px 14px;
    background: #fafafa;
    border-bottom: 1px solid #ececec;
    text-align: right;
    font-size: 13px;
    color: #777;
    font-weight: 700;
}

.ikco-ticket-table td {
    padding: 14px;
    border-bottom: 1px solid #f3f3f3;
    font-size: 14px;
    vertical-align: middle;
}

.ikco-ticket-table tbody tr:last-child td {
    border-bottom: 0;
}

.ikco-ticket-table tbody tr:hover td {
    background: #fcfcfc;
}

.ikco-ticket-subject {
    font-weight: 700;
    color: #222;
}

.ikco-ticket-actions {
    text-align: left;
}

.ikco-ticket-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}

.ikco-ticket-badge.is-open     { background: #fff7e6; color: #c98500; }
.ikco-ticket-badge.is-answered { background: #e9f9ef; color: #1f9254; }
.ikco-ticket-badge.is-closed   { background: #f0f1f3; color: #777; }

/* --- حالت خالی --- */
.ikco-ticket-empty {
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    border: 1px dashed #dcdfe4;
    border-radius: 16px;
    color: #666;
}

.ikco-ticket-empty-icon {
    font-size: 38px;
    margin-bottom: 6px;
}

/* --- موبایل: جدول به کارت تبدیل می‌شود --- */
@media (max-width: 600px) {
    .ikco-tab {
        padding: 10px 8px;
        font-size: 13px;
    }

    .ikco-tab-icon {
        display: none;
    }

    .ikco-ticket-table,
    .ikco-ticket-table tbody,
    .ikco-ticket-table tr,
    .ikco-ticket-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .ikco-ticket-table thead {
        display: none;
    }

    .ikco-ticket-table {
        border: 0;
        background: transparent;
    }

    .ikco-ticket-table tr {
        margin-bottom: 12px;
        border: 1px solid #ececec;
        border-radius: 14px;
        background: #fff;
        overflow: hidden;
    }

    .ikco-ticket-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        border-bottom: 1px solid #f3f3f3;
    }

    .ikco-ticket-table td::before {
        content: attr(data-label);
        font-size: 12px;
        color: #999;
        font-weight: 700;
    }

    .ikco-ticket-table td.ikco-ticket-actions {
        justify-content: flex-end;
    }

    .ikco-ticket-table td.ikco-ticket-actions::before {
        content: none;
    }
}