/* ============================================
   ZX Analyzer - استایل کامل
   ============================================ */

/* ===== ریست ===== */
.zx-wrapper * {
    box-sizing: border-box;
}

.zx-wrapper {
    max-width: 860px;
    margin: 30px auto;
    padding: 0 20px 30px;
    direction: rtl;
    font-family: inherit;
    color: #202124;
}

/* ===== هدر ===== */
.zx-header {
    text-align: center;
    padding: 15px 0 20px;
}

.zx-header h2 {
    font-size: 26px;
    font-weight: 400;
    color: #202124;
    margin: 0;
    font-family: inherit;
}

.zx-header p {
    color: #5f6368;
    font-size: 14px;
    margin: 4px 0 0;
    font-family: inherit;
}

/* ===== فرم ===== */
.zx-form-wrapper {
    max-width: 580px;
    margin: 0 auto;
    padding: 0 10px;
}

.zx-form {
    display: flex;
    width: 100%;
    background: #f1f3f4;
    border-radius: 24px;
    padding: 4px;
    font-family: inherit;
}

.zx-form input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    font-size: 15px;
    color: #202124;
    outline: none;
    min-width: 0;
    font-family: inherit;
}

.zx-form input::placeholder {
    color: #80868b;
}

.zx-btn {
    padding: 10px 28px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.zx-btn:hover {
    background: #1557b0;
}

.zx-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ===== نوار ابزار ===== */
.zx-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #e8eaed;
    margin-bottom: 20px;
    width: 100%;
}

.zx-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.zx-reanalyze-btn {
    padding: 8px 20px;
    background: #f1f3f4;
    border: 1px solid #dadce0;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #202124;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.zx-reanalyze-btn:hover {
    background: #e8eaed;
    border-color: #1a73e8;
    color: #1a73e8;
}

.zx-analysis-date {
    font-size: 12px;
    color: #5f6368;
    font-family: inherit;
}

/* ===== تب‌ها ===== */
.zx-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0 25px;
}

.zx-tab-btn {
    padding: 10px 30px;
    background: #f1f3f4;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.zx-tab-btn:hover {
    background: #e8eaed;
}

.zx-tab-btn.active {
    background: #1a73e8;
    color: #fff;
}

.zx-tab-content {
    display: none;
}

.zx-tab-content.active {
    display: block;
}

/* ===== امتیاز کلی ===== */
.zx-score-wrap {
    text-align: center;
    padding: 20px 0 25px;
    border-bottom: 1px solid #e8eaed;
    margin-bottom: 24px;
}

.zx-score-circle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: #f8f9fa;
    border: 6px solid #1a73e8;
}

.zx-score-circle .num {
    font-size: 40px;
    font-weight: 500;
    color: #202124;
    line-height: 1;
}

.zx-score-circle .lbl {
    font-size: 11px;
    color: #5f6368;
    margin-top: 2px;
}

.zx-score-circle.good { border-color: #34a853; background: #e6f4ea; }
.zx-score-circle.good .num { color: #1e8e3e; }
.zx-score-circle.avg { border-color: #f9ab00; background: #fef7e0; }
.zx-score-circle.avg .num { color: #b68a00; }
.zx-score-circle.poor { border-color: #ea4335; background: #fce8e6; }
.zx-score-circle.poor .num { color: #c62828; }

/* ===== ۴ دایره اصلی ===== */
.zx-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

.zx-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 4px 14px;
    background: #fafafa;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.zx-item:hover {
    background: #f1f3f4;
    border-color: #e8eaed;
}

.zx-item.active {
    border-color: #1a73e8;
    background: #e8f0fe;
}

.zx-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: #202124;
    background: #f8f9fa;
    border: 4px solid #1a73e8;
    margin-bottom: 6px;
    transition: all 0.3s;
}

.zx-ring.good { border-color: #34a853; background: #e6f4ea; color: #1e8e3e; }
.zx-ring.avg { border-color: #f9ab00; background: #fef7e0; color: #b68a00; }
.zx-ring.poor { border-color: #ea4335; background: #fce8e6; color: #c62828; }

.zx-item .name {
    font-size: 13px;
    font-weight: 500;
    color: #3c4043;
}

.zx-item .status {
    font-size: 11px;
    color: #5f6368;
    margin-top: 2px;
}

/* ===== کارت‌های جزئیات ===== */
.zx-details-title {
    font-size: 16px;
    font-weight: 500;
    color: #202124;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8eaed;
    margin-bottom: 14px;
}

.zx-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zx-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e8eaed;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.zx-card-header {
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #fafafa;
    transition: background 0.2s;
    user-select: none;
}

.zx-card-header:hover {
    background: #f1f3f4;
}

.zx-card-header .title {
    font-size: 14px;
    font-weight: 600;
    color: #202124;
}

.zx-card-header .badge {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 12px;
    border-radius: 12px;
    background: #e8f0fe;
    color: #1a73e8;
}

.zx-card-header .arrow {
    font-size: 12px;
    color: #5f6368;
    transition: transform 0.3s;
    margin-right: 10px;
}

.zx-card-header .arrow.open {
    transform: rotate(180deg);
}

.zx-card-header .problems-count {
    font-size: 12px;
    color: #ea4335;
    margin-left: 10px;
    font-weight: 500;
}

.zx-card-body {
    display: none;
    padding: 0 18px 16px;
    border-top: 1px solid #e8eaed;
    background: #ffffff;
}

.zx-card-body.open {
    display: block;
}

.zx-card-body .issue-group {
    margin-top: 10px;
}

.zx-card-body .issue-group .group-title {
    font-size: 12px;
    font-weight: 600;
    color: #5f6368;
    padding: 6px 0 4px;
    border-bottom: 1px dashed #e8eaed;
    margin-bottom: 4px;
}

.zx-card-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.zx-card-body ul li {
    font-size: 13px;
    color: #3c4043;
    padding: 6px 0;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border-bottom: 1px solid #f5f5f5;
}

.zx-card-body ul li:last-child {
    border-bottom: none;
}

.zx-card-body ul li .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.zx-card-body ul li .dot.green { background: #34a853; }
.zx-card-body ul li .dot.yellow { background: #f9ab00; }
.zx-card-body ul li .dot.red { background: #ea4335; }
.zx-card-body ul li .dot.blue { background: #1a73e8; }

.zx-card-body ul li .green { color: #1e8e3e; }
.zx-card-body ul li .yellow { color: #b68a00; }
.zx-card-body ul li .red { color: #c62828; }
.zx-card-body ul li .blue { color: #1a73e8; }

/* ===== دکمه مشاهده جزئیات ===== */
.zx-detail-toggle {
    font-size: 12px;
    color: #1a73e8;
    cursor: pointer;
    background: none;
    border: none;
    padding: 6px 0;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}

.zx-detail-toggle:hover {
    text-decoration: underline;
}

.zx-detail-content {
    display: none;
    background: #f8f9fa;
    padding: 12px 14px;
    border-radius: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: #3c4043;
    border-right: 3px solid #1a73e8;
}

.zx-detail-content.open {
    display: block;
}

.zx-detail-content .item {
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #e8eaed;
}

.zx-detail-content .item:last-child {
    border-bottom: none;
}

.zx-detail-content .item .label {
    color: #5f6368;
}

.zx-detail-content .item .value {
    font-weight: 500;
    color: #202124;
}

/* ===== لینک‌های شکسته ===== */
.zx-broken-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.zx-broken-stats .stat-item {
    background: #fff;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e8eaed;
}

.zx-broken-stats .stat-item .num {
    font-size: 18px;
    font-weight: 600;
    color: #202124;
    display: block;
}

.zx-broken-stats .stat-item .label {
    font-size: 10px;
    color: #5f6368;
}

.zx-broken-list {
    max-height: 250px;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e8eaed;
}

.zx-broken-list .category-title {
    font-weight: 600;
    color: #202124;
    padding: 6px 10px;
    background: #fce8e6;
    border-bottom: 1px solid #e8eaed;
    font-size: 12px;
}

.zx-broken-list .broken-item {
    padding: 8px 10px;
    border-bottom: 1px solid #f5f5f5;
}

.zx-broken-list .broken-item:last-child {
    border-bottom: none;
}

.zx-broken-list .broken-url {
    font-size: 12px;
    color: #c62828;
    word-break: break-all;
    font-weight: 500;
}

.zx-broken-list .broken-info {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 11px;
    color: #5f6368;
}

.zx-broken-list .broken-status {
    background: #fce8e6;
    padding: 1px 8px;
    border-radius: 10px;
    color: #c62828;
}

.zx-broken-list .broken-text {
    color: #3c4043;
}

.zx-broken-empty {
    text-align: center;
    padding: 20px;
    font-size: 14px;
    color: #34a853;
    background: #e6f4ea;
    border-radius: 8px;
}

/* ===== ساختار URL ===== */
.zx-url-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
    background: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e8eaed;
}

.zx-url-grid .url-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #f5f5f5;
}

.zx-url-grid .url-item:last-child {
    border-bottom: none;
}

.zx-url-grid .url-item .label {
    font-size: 11px;
    color: #5f6368;
}

.zx-url-grid .url-item .value {
    font-size: 12px;
    font-weight: 500;
    color: #202124;
    word-break: break-all;
    text-align: left;
}

/* ===== پیشنهادات عملی ===== */
.zx-suggestions-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e8eaed;
}

.zx-suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.zx-suggestion-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px 18px;
    border-right: 4px solid #1a73e8;
    transition: all 0.2s;
}

.zx-suggestion-card:hover {
    background: #f1f3f4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.zx-suggestion-card.priority-high {
    border-right-color: #ea4335;
    background: #fce8e6;
}

.zx-suggestion-card.priority-high:hover {
    background: #fce8e6;
}

.zx-suggestion-card.priority-medium {
    border-right-color: #f9ab00;
    background: #fef7e0;
}

.zx-suggestion-card.priority-medium:hover {
    background: #fef7e0;
}

.zx-suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.zx-suggestion-category {
    font-size: 11px;
    font-weight: 600;
    color: #1a73e8;
    background: #e8f0fe;
    padding: 2px 10px;
    border-radius: 10px;
}

.zx-suggestion-priority {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
}

.zx-suggestion-card.priority-high .zx-suggestion-priority {
    background: #fce8e6;
    color: #c62828;
}

.zx-suggestion-card.priority-medium .zx-suggestion-priority {
    background: #fef7e0;
    color: #b68a00;
}

.zx-suggestion-title {
    font-size: 15px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 6px;
}

.zx-suggestion-desc {
    font-size: 13px;
    color: #3c4043;
    margin-bottom: 8px;
    line-height: 1.6;
}

.zx-suggestion-action {
    font-size: 12px;
    color: #1a73e8;
    background: #e8f0fe;
    padding: 8px 12px;
    border-radius: 8px;
    line-height: 1.6;
}

.zx-suggestion-empty {
    text-align: center;
    padding: 30px;
    font-size: 16px;
    color: #34a853;
    background: #e6f4ea;
    border-radius: 12px;
}

/* ===== جزئیات درخواست‌ها ===== */
.zx-request-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.zx-request-stats .stat-item {
    background: #fff;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e8eaed;
}

.zx-request-stats .stat-item .num {
    font-size: 18px;
    font-weight: 600;
    color: #202124;
    display: block;
}

.zx-request-stats .stat-item .label {
    font-size: 10px;
    color: #5f6368;
}

.zx-request-list {
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e8eaed;
}

.zx-request-list .category {
    margin: 4px 0;
}

.zx-request-list .category-title {
    font-weight: 600;
    color: #202124;
    padding: 6px 10px;
    background: #f1f3f4;
    border-bottom: 1px solid #e8eaed;
    font-size: 12px;
}

.zx-request-list .request-item {
    font-size: 11px;
    padding: 4px 10px;
    color: #3c4043;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.zx-request-list .request-item .url {
    word-break: break-all;
    flex: 1;
}

.zx-request-list .request-item .type {
    font-size: 9px;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.zx-request-list .request-item .type.internal {
    background: #e6f4ea;
    color: #1e8e3e;
}

.zx-request-list .request-item .type.external {
    background: #fce8e6;
    color: #c62828;
}

/* ===== بج پیج اسپید ===== */
.zx-pagespeed-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 16px;
    background: #1a73e8;
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* ===== مودال ===== */
.zx-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: zx-modal-fade 0.3s ease;
}

@keyframes zx-modal-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.zx-modal {
    background: #ffffff;
    border-radius: 16px;
    max-width: 520px;
    width: 90%;
    padding: 32px 30px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: zx-modal-slide 0.4s ease;
}

@keyframes zx-modal-slide {
    from { transform: translateY(-30px) scale(0.96); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.zx-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.zx-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #202124;
}

.zx-modal-url {
    font-size: 14px;
    color: #5f6368;
    margin-top: 4px;
    word-break: break-all;
}

.zx-modal-body {
    padding: 0;
}

.zx-modal-progress {
    position: relative;
    width: 100%;
    height: 6px;
    background: #e8eaed;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 22px;
}

.zx-modal-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1a73e8, #34a853);
    border-radius: 6px;
    transition: width 0.5s ease;
    width: 0%;
}

.zx-modal-progress-text {
    position: absolute;
    right: 0;
    top: -18px;
    font-size: 11px;
    color: #5f6368;
}

.zx-modal-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.zx-modal-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s;
    opacity: 0.5;
}

.zx-modal-step.active {
    opacity: 1;
    background: #e8f0fe;
}

.zx-modal-step-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
    color: #5f6368;
    font-weight: 600;
}

.zx-modal-step-icon.pending {
    color: #9aa0a6;
}

.zx-modal-step-icon.active {
    color: #1a73e8;
    animation: zx-pulse 0.8s ease infinite;
}

.zx-modal-step-icon.done {
    color: #34a853;
}

@keyframes zx-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.zx-modal-step-label {
    flex: 1;
    font-size: 14px;
    color: #202124;
}

.zx-modal-step-status {
    font-size: 12px;
    color: #5f6368;
}

.zx-modal-step.active .zx-modal-step-status {
    color: #1a73e8;
}

/* ===== خطا ===== */
.zx-error {
    background: #fce8e6;
    padding: 18px;
    border-radius: 12px;
    color: #c62828;
    text-align: center;
    font-size: 14px;
}

/* ============================================
   ریسپانسیو
   ============================================ */
@media (max-width: 600px) {
    .zx-form-wrapper {
        max-width: 100%;
        padding: 0;
    }

    .zx-form {
        flex-direction: column;
        background: transparent;
        padding: 0;
        border: none;
    }

    .zx-form input {
        background: #f1f3f4;
        border-radius: 24px;
        padding: 12px 20px;
        border: 1px solid #e8eaed;
        margin-bottom: 8px;
    }

    .zx-btn {
        width: 100%;
        text-align: center;
        border-radius: 24px;
        padding: 12px;
    }

    .zx-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .zx-ring {
        width: 60px;
        height: 60px;
        font-size: 17px;
        border-width: 3px;
    }

    .zx-score-circle {
        width: 110px;
        height: 110px;
    }

    .zx-score-circle .num {
        font-size: 34px;
    }

    .zx-tabs {
        flex-wrap: wrap;
    }

    .zx-tab-btn {
        flex: 1;
        text-align: center;
        padding: 8px 16px;
        font-size: 13px;
    }

    .zx-request-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .zx-broken-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .zx-url-grid {
        grid-template-columns: 1fr;
    }

    .zx-suggestions-grid {
        grid-template-columns: 1fr;
    }
    
    .zx-toolbar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .zx-toolbar-left {
        justify-content: center;
    }

    .zx-modal {
        padding: 24px 20px 20px;
        max-width: 95%;
    }

    .zx-modal-title {
        font-size: 17px;
    }

    .zx-modal-step {
        padding: 6px 10px;
    }

    .zx-modal-step-label {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .zx-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .zx-ring {
        width: 50px;
        height: 50px;
        font-size: 15px;
        border-width: 3px;
    }

    .zx-item .name {
        font-size: 11px;
    }

    .zx-score-circle {
        width: 90px;
        height: 90px;
        border-width: 5px;
    }

    .zx-score-circle .num {
        font-size: 28px;
    }

    .zx-header h2 {
        font-size: 22px;
    }

    .zx-broken-stats {
        grid-template-columns: 1fr 1fr;
    }
}