:root {
    --brand-primary: #006b98;
    --brand-secondary: #10b981;
    --brand-warning: #f59e0b;
    --brand-danger: #ef4444;
    --bg-app: #f1f5f9;
    --surface-card: #ffffff;
    --text-heading: #1e293b;
    --text-body: #475569;
    --border-subtle: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

body { background-color: var(--bg-app); font-family: 'Cairo', sans-serif; color: var(--text-body); }

.page-header-unified {
    background: linear-gradient(135deg, #006b98 0%, #004d6e 100%);
    padding: 100px 0 80px;
    color: white;
    text-align: center;
    clip-path: ellipse(150% 100% at 50% 0%);
}

.checker-container { padding: 40px 0; margin-top: -60px; }

/* Modern Tool Selector */
.tool-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.tool-tile {
    background: var(--surface-card);
    padding: 25px 15px;
    border-radius: 24px;
    border: 1px solid var(--border-subtle);
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}
.tool-tile i { font-size: 28px; color: var(--brand-primary); margin-bottom: 12px; transition: 0.3s; }
.tool-tile span { display: block; font-weight: 800; font-size: 12px; color: var(--text-heading); }
.tool-tile:hover { transform: translateY(-8px); border-color: var(--brand-primary); box-shadow: var(--shadow-lg); }
.tool-tile.active {
    background: var(--surface-card);
    border: 3px solid var(--brand-primary);
    box-shadow: 0 0 20px rgba(0, 107, 152, 0.2);
    transform: translateY(-5px);
}
.tool-tile.active i { color: var(--brand-primary); transform: scale(1.1); }
.tool-tile.active span { color: var(--brand-primary); }

.search-card {
    background: var(--surface-card);
    padding: 40px;
    border-radius: 32px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
    border: 1px solid var(--border-subtle);
}

.input-group-custom {
    display: flex;
    background: var(--bg-app);
    padding: 10px;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    transition: 0.3s;
    direction: ltr;
}
.input-group-custom:focus-within { border-color: var(--brand-primary); box-shadow: 0 0 0 4px rgba(0, 107, 152, 0.1); }
.url-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 20px;
    font-size: 16px;
    outline: none;
    color: var(--text-heading);
    text-align: left;
    font-family: sans-serif;
}
.url-input::placeholder { text-align: right; font-family: 'Cairo', sans-serif; }
.code-editor {
    width: 100%;
    height: 250px;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    direction: ltr;
    tab-size: 4;
}
.code-editor:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 4px rgba(0, 107, 152, 0.1); }
.btn-analyze { background: var(--brand-primary); color: white; border: none; padding: 0 35px; border-radius: 16px; font-weight: 800; cursor: pointer; transition: 0.3s; white-space: nowrap; }
.btn-analyze:hover { background: #004d6e; transform: scale(1.02); }

.tabs-custom { display: flex; gap: 15px; margin-bottom: 25px; justify-content: center; }
.tab-item { padding: 10px 25px; background: var(--border-subtle); border-radius: 50px; cursor: pointer; font-weight: 700; font-size: 14px; color: var(--text-body); transition: 0.3s; }
.tab-item.active { background: var(--brand-primary); color: white; box-shadow: var(--shadow-md); }


/* Improved Result Cards */
.result-card {
    background: var(--surface-card);
    padding: 30px;
    border-radius: 28px;
    border: 1px solid var(--border-subtle);
    margin-bottom: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.result-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--brand-primary); }

.priority-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.status-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}
.status-badge.status-pass { background: #dcfce7; color: #15803d; }
.status-badge.status-warn { background: #fef3c7; color: #b45309; }
.status-badge.status-fail { background: #fee2e2; color: #b91c1c; }

.p-critical { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.p-moderate { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.p-minor { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }

.tag-title { font-weight: 800; color: var(--text-heading); font-size: 15px; display: flex; align-items: center; gap: 12px; }
.tag-value {
    font-size: 14px;
    color: var(--brand-primary);
    background: var(--bg-app);
    padding: 15px;
    border-radius: 12px;
    margin-top: 12px;
    font-weight: 700;
    word-break: break-all;
    border-right: 4px solid var(--brand-primary);
    font-family: monospace;
}

.section-title {
    font-weight: 800;
    color: var(--brand-primary);
    margin: 50px 0 25px;
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 2px solid var(--border-subtle);
    position: relative;
}
.section-title i { width: 40px; height: 40px; background: var(--bg-app); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--brand-primary); font-size: 18px; }
.section-title::after {
    content: "";
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 60px;
    height: 3px;
    background: var(--brand-primary);
    border-radius: 5px;
}

/* Category Dashboard */
.category-scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}
.cat-score-card { background: var(--surface-card); padding: 20px; border-radius: 24px; border: 1px solid var(--border-subtle); text-align: center; box-shadow: var(--shadow-sm); transition: 0.3s; }
.cat-score-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--brand-primary); }
.cat-score-circle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: 5px solid var(--border-subtle);
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    position: relative;
    background: var(--surface-card);
}
.cat-score-circle svg { position: absolute; top: -5px; left: -5px; transform: rotate(-90deg); overflow: visible; }
.cat-label { font-size: 10px; font-weight: 800; color: var(--text-body); letter-spacing: 0.5px; }

/* History Sidebar */
.history-card { background: var(--surface-card); padding: 25px; border-radius: 24px; border: 1px solid var(--border-subtle); box-shadow: var(--shadow-md); }
.history-item {
    padding: 15px;
    border-radius: 16px;
    margin-bottom: 10px;
    background: var(--bg-app);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
}
.history-item:hover { transform: scale(1.02); background: var(--border-subtle); }
.history-item b { font-size: 13px; color: var(--text-heading); margin-bottom: 5px; }
.history-item span { font-size: 11px; color: var(--text-body); }

/* SERP Simulation Pro */
.serp-container { background: #fff; border: 1px solid #dfe1e5; border-radius: 12px; padding: 25px; box-shadow: var(--shadow-sm); }
.serp-url { color: #202124; font-size: 14px; margin-bottom: 5px; font-family: arial, sans-serif; }
.serp-title { color: #1a0dab; font-size: 20px; font-family: arial, sans-serif; margin-bottom: 5px; cursor: pointer; }
.serp-title:hover { text-decoration: underline; }
.serp-desc { color: #4d5156; font-size: 14px; line-height: 1.58; font-family: arial, sans-serif; }

/* Fix Guide Components */
.fix-btn { margin-top: 15px; border: 2px solid var(--brand-primary); background: transparent; color: var(--brand-primary); padding: 6px 18px; border-radius: 10px; font-weight: 800; font-size: 12px; cursor: pointer; transition: 0.3s; }
.fix-btn:hover { background: var(--brand-primary); color: white; }
.close-modal {
    width: 40px;
    height: 40px;
    background: var(--bg-app);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}
.close-modal:hover { background: var(--brand-primary); color: #fff; transform: rotate(90deg); }

/* Fix Modal System */
.fix-modal {
    display: none !important;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.fix-modal.show { display: flex !important; }

.modal-content {
    background: var(--surface-card);
    border: none;
    border-radius: 32px;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 100%;
    padding: 40px;
    position: relative;
    animation: modalFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.res-source {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    padding: 20px;
    border-radius: 24px;
    flex: 1;
    min-width: 140px;
    box-shadow: var(--shadow-sm);
    transition: 0.3s;
    text-align: center;
}
.res-source:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--brand-primary); }
.res-source-name { display: block; font-weight: 800; font-size: 11px; color: var(--brand-primary); margin-bottom: 8px; text-transform: uppercase; }
.res-source-count { font-size: 24px; font-weight: 900; color: var(--text-heading); }

/* Links Explorer Table Pro */
.table-container {
    background: var(--surface-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
}
.links-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.links-table th {
    background: var(--bg-app);
    color: var(--brand-primary);
    padding: 15px 20px;
    font-weight: 800;
    font-size: 13px;
    text-align: right;
    border-bottom: 2px solid var(--border-subtle);
}
.links-table td {
    padding: 15px 20px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-subtle);
    transition: 0.2s;
}
.links-table tr:last-child td { border-bottom: none; }
.links-table tr:hover td { background: rgba(0, 107, 152, 0.02); }

.link-text-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text-heading);
}
.link-url-text {
    font-family: 'Consolas', monospace;
    font-size: 11px;
    color: var(--text-body);
    opacity: 0.7;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    direction: ltr;
    text-align: left;
}

.badge-link {
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.badge-internal { background: #e0f2fe; color: #0369a1; }
.badge-external { background: #f0fdf4; color: #166534; }
.badge-dead { background: #fef2f2; color: #991b1b; }

.copy-link-btn {
    border: none;
    background: var(--bg-app);
    color: var(--brand-primary);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}
.copy-link-btn:hover { background: var(--brand-primary); color: white; }

/* Summary Card Pro - White Theme Enhanced */
.summary-card-pro {
    background: #ffffff;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05) !important;
    border: 1px solid var(--border-subtle) !important;
    direction: rtl;
}
.summary-header {
    padding: 25px 30px;
    display: flex;
    align-items: center;
    background: #fff;
    gap: 20px;
}
.site-icon-box {
    width: 54px;
    height: 54px;
    background: #f8fafc;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.site-icon-box img { border-radius: 8px; object-fit: contain; }
.site-icon-box i { font-size: 24px; }

.summary-body.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    padding: 25px;
    gap: 15px;
    background: #fcfdfe;
}
.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px;
    border-radius: 20px;
    border: 1px solid #f1f5f9;
    background: white;
    transition: 0.3s;
}
.stat-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.stat-item .label {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-item .value {
    font-weight: 900;
    font-size: 15px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}
.stat-item i { font-size: 18px !important; width: auto !important; height: auto !important; background: transparent !important; }

.resource-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
}
.res-mini-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    font-weight: 800;
}
.res-mini-item i { font-size: 14px !important; margin-bottom: 4px; }

.ltr-text { direction: ltr; display: inline-block; }

/* Social Cards Simulation */
.social-card-fb {
    background: #f0f2f5;
    border: 1px solid #dddfe2;
    border-radius: 0;
    overflow: hidden;
    font-family: Helvetica, Arial, sans-serif;
}
.fb-img-box {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #e9ebee;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fb-content {
    padding: 12px;
    background: #f0f2f5;
    border-top: 1px solid #dddfe2;
}
.fb-domain { color: #606770; font-size: 12px; margin-bottom: 2px; }
.fb-title { color: #1d2129; font-weight: 600; font-size: 16px; line-height: 20px; margin-bottom: 4px; }
.fb-desc { color: #606770; font-size: 14px; line-height: 18px; height: 36px; overflow: hidden; }

.social-card-tw {
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.tw-img-box {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: #f5f8fa;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tw-content {
    padding: 12px;
}
.tw-title { color: #000; font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.tw-desc { color: #536471; font-size: 15px; line-height: 20px; margin-bottom: 4px; }
.tw-domain { color: #536471; font-size: 14px; }

.badge-primary-soft { background: rgba(0, 107, 152, 0.1); color: var(--brand-primary); border: 1px solid rgba(0, 107, 152, 0.2); }
.badge-warning-soft { background: rgba(245, 158, 11, 0.1); color: #b45309; border: 1px solid rgba(245, 158, 11, 0.2); }

.results-dashboard { display: none !important; }


.results-dashboard.visible { display: block !important; }

    /* Accordion Style for Results */
    .result-card {
        cursor: pointer;
        padding: 20px;
    }
    .result-details {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out, padding 0.3s ease;
        padding: 0 5px;
    }
    .result-card.expanded .result-details {
        max-height: 1000px;
        padding: 15px 5px 0;
    }
    .result-card .expand-icon {
        transition: transform 0.3s;
        color: var(--text-body);
        font-size: 14px;
    }
    .result-card.expanded .expand-icon {
        transform: rotate(180deg);
    }

    /* Chart Container */
    .chart-container {
        position: relative;
        height: 350px;
        width: 100%;
        margin-bottom: 40px;
        background: var(--surface-card);
        padding: 25px;
        border-radius: 28px;
        border: 1px solid var(--border-subtle);
        box-shadow: var(--shadow-md);
    }

    /* Smart Recommendation */
    .smart-rec {
        background: linear-gradient(135deg, #fff 0%, #f0f9ff 100%);
        border: 2px dashed var(--brand-primary);
        padding: 20px;
        border-radius: 24px;
        margin-bottom: 30px;
        display: none;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        animation: pulse-border 2s infinite;
    }
    @keyframes pulse-border {
        0% { border-color: var(--brand-primary); }
        50% { border-color: var(--brand-secondary); }
        100% { border-color: var(--brand-primary); }
    }
    .smart-rec-text { flex: 1; }
    .smart-rec-btn { background: var(--brand-primary); color: white; padding: 10px 20px; border-radius: 12px; font-weight: 800; text-decoration: none; }

.loader-wrapper {
    display: none;
    text-align: center;
    padding: 60px 20px;
    background: var(--surface-card);
    border-radius: 32px;
    border: 1px solid var(--border-subtle);
    margin-bottom: 40px;
    box-shadow: var(--shadow-md);
}

@media (max-width: 992px) {
    .checker-container { margin-top: -30px; }
    .search-card { padding: 25px; }
    .url-input { padding: 10px; font-size: 14px; }
}

/* Content Quality Specifics */
.fw-800 { font-weight: 800; }
.keyword-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    padding: 6px 15px;
    border-radius: 50px;
    margin: 5px;
    font-size: 13px;
    font-weight: 700;
    transition: 0.3s;
}
.keyword-pill span {
    background: var(--brand-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}
.stat-box {
    transition: 0.3s;
}
.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-primary) !important;
}

/* Print Styles */
@media print {
    .no-print, site-header, site-footer, .page-header-unified, .tool-selector, .search-card, .history-card, .related-tools-section, .fix-modal, .breadcrumb-custom {
        display: none !important;
    }
    body { background: white !important; }
    .checker-container { margin-top: 0 !important; padding: 0 !important; }
    .container { max-width: 100% !important; width: 100% !important; margin: 0 !important; }
    .col-lg-8, .col-lg-4 { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }
    .results-dashboard { display: block !important; }
    .result-card {
        break-inside: avoid;
        border: 1px solid #eee !important;
        margin-bottom: 15px !important;
        box-shadow: none !important;
    }
    .result-details { max-height: none !important; display: block !important; padding: 10px !important; }
    .expand-icon { display: none !important; }
    .section-title { color: #000 !important; border-bottom: 1px solid #000 !important; margin-top: 30px !important; }
    .score-card { border: 2px solid #000 !important; page-break-after: always; }
}

