/* =======================================================
 * SEOLYZER - REPORT PAGE STYLES (COMPLETE)
 * ======================================================= */
 @import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;700&display=swap');

/* --- 1. GLOBAL & UTILITY --- */
:root {
    --primary-color: #4f46e5;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-500: #6b7280;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white-color: #ffffff;
    --card-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: #f9fafb;
    color: var(--gray-800);
}

.page-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.hidden { display: none !important; }

.btn, .action-hub-btn, .btn-download-pdf {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.6rem 1.2rem; border-radius: 8px; border: 1px solid transparent;
    font-weight: 600; text-decoration: none; cursor: pointer;
    transition: all 0.2s ease;
}

/* --- 2. LOADER, HEADER (UNCHANGED FROM PREVIOUS) --- */
.analysis-loading-container { opacity: 1; transition: opacity 0.4s ease-in-out; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(249, 250, 251, 0.95); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.analysis-loading-container.fade-out { opacity: 0; pointer-events: none; }
.loading-card { background: var(--white-color); padding: 2rem; border-radius: 1rem; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); width: 100%; max-width: 500px; text-align: center; }
.loading-header { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 1.5rem; }
.loading-spinner-wrapper .loading-spinner-arc { width: 48px; height: 48px; border: 5px solid var(--primary-color); border-bottom-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title-group h1 { font-size: 1.5rem; font-weight: 700; color: var(--gray-800); margin: 0; }
.loading-title-group p { margin: 0; color: var(--gray-500); }
.progress-bar-wrapper { background-color: var(--gray-100); height: 10px; border-radius: 5px; overflow: hidden; margin-bottom: 1.5rem; }
.progress-bar { width: 0; height: 100%; background-color: var(--primary-color); transition: width 0.5s ease-out; }
.progress-checklist { text-align: left; max-height: 40vh; overflow-y: auto; }
.checklist-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; opacity: 0.5; transition: opacity 0.3s; }
.checklist-item.completed { opacity: 1; }
.checklist-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.checklist-icon.pending i { color: var(--gray-500); }
.checklist-icon.completed i { color: var(--success-color); }
.results-header-v2 { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: 1rem; background-color: var(--white-color); border: 1px solid var(--gray-200); border-radius: 0.75rem; margin-bottom: 2rem; }
.url-display { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; overflow: hidden; }
.url-display a { color: var(--gray-800); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.url-display a:hover { color: var(--primary-color); }
.header-actions-v2 { display: flex; gap: 0.5rem; flex-shrink: 0; }
.action-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.5rem; border: 1px solid var(--gray-200); background-color: var(--white-color); border-radius: 0.5rem; color: var(--gray-500); text-decoration: none; }
.btn-download-pdf { gap: 0.5rem; padding: 0.5rem 1rem; background-color: var(--primary-color); color: var(--white-color); }

/* --- 3. ANALYTICS DASHBOARD (REDESIGNED) --- */
.analytics-dashboard { display: grid; grid-template-columns: 380px 1fr; gap: 2rem; margin-bottom: 2.5rem; }
.summary-card { background-color: rgba(255, 255, 255, 0.7); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 16px; padding: 1.5rem; box-shadow: var(--card-shadow); }
.main-score-card { grid-row: 1 / 3; text-align: center; }
.main-score-card h3 { margin-top: 0; margin-bottom: 1.5rem; font-size: 1.1rem; }
.main-score-display { display: flex; justify-content: center; align-items: baseline; line-height: 1; }
.main-score-value { font-size: 5rem; font-weight: 700; transition: color 0.3s; }
.main-score-value.good { color: var(--success-color); }
.main-score-value.average { color: var(--warning-color); }
.main-score-value.bad { color: var(--danger-color); }
.main-score-label { font-size: 1.5rem; font-weight: 500; color: var(--gray-500); margin-left: 0.5rem; }
.score-description { font-size: 1.1rem; font-weight: 500; margin: 1rem 0 1.5rem; }
.main-score-actions { display: flex; gap: 0.75rem; justify-content: center; margin-bottom: 1.5rem; }
.action-hub-btn { border: 1px solid var(--gray-200); background-color: var(--white-color); color: var(--gray-800); }
.insight-cards-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.5); }
.insight-card { position: relative; padding: 1rem; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; background-color: rgba(241, 245, 249, 0.6); border: 1px solid transparent; cursor: default; }
.card-content { text-align: left; }
.card-value { display: block; font-size: 2rem; font-weight: 700; line-height: 1; }
.card-label { font-size: 0.9rem; font-weight: 500; color: var(--gray-500); }
.card-icon { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); opacity: 0.1; }
.card-icon .feather { width: 48px; height: 48px; }
.insight-card.passed { border-color: rgba(16, 185, 129, 0.3); }
.insight-card.passed .card-value, .insight-card.passed .card-icon { color: var(--success-color); }
.insight-card.failed { border-color: rgba(239, 68, 68, 0.3); }
.insight-card.failed .card-value, .insight-card.failed .card-icon { color: var(--danger-color); }
.insight-card[data-tooltip]:hover::after { content: attr(data-tooltip); position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%); background-color: var(--gray-900); color: var(--white-color); padding: 0.6rem 0.8rem; border-radius: 6px; font-size: 0.85rem; white-space: normal; width: 220px; line-height: 1.5; z-index: 10; }
.top-priority-issue { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.5); }
.top-priority-issue a { display: flex; align-items: center; background-color: #fffbeB; padding: 1rem; border-radius: 10px; text-decoration: none; transition: all 0.2s; border: 1px solid #fef3c7; }
.top-priority-issue a:hover { background-color: #fefce8; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(245, 158, 11, 0.1); }
.priority-icon { flex-shrink: 0; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background-color: var(--warning-color); color: var(--white-color); margin-right: 1rem; }
.priority-details { flex-grow: 1; text-align: left; }
.priority-details span { display: block; font-size: 0.8rem; font-weight: 500; color: #b45309; }
.priority-details strong { display: block; font-size: 1rem; font-weight: 600; color: #92400e; }
.priority-arrow { color: #d97706; }
.sub-scores-list { display: flex; flex-direction: column; gap: 1.25rem; }
.sub-score-item { background: var(--white-color); padding: 1.25rem; border-radius: 12px; border: 1px solid var(--gray-200); }
.sub-score-header { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.9rem; margin-bottom: 0.5rem; }
.sub-score-label { display: inline-flex; align-items: center; gap: 0.3rem; position: relative; color: var(--gray-500); cursor: help; }
.help-icon { width: 14px; height: 14px; color: #cbd5e0; }
.sub-score-percent { font-weight: 600; color: var(--gray-800); }
.sub-score-bar-container { height: 8px; background-color: var(--gray-100); border-radius: 4px; overflow: hidden; }
.sub-score-bar { width: 0%; height: 100%; border-radius: 4px; transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1); }
.sub-score-bar.good { background-color: var(--success-color); }
.sub-score-bar.average { background-color: var(--warning-color); }
.sub-score-bar.bad { background-color: var(--danger-color); }

/* --- 4. CHECKLISTS & ACCORDION (CORRECTED) --- */
.checklist-container { display: flex; flex-direction: column; gap: 1rem; }
.checklist-accordion-item { background-color: var(--white-color); border-radius: 8px; border: 1px solid var(--gray-200); transition: box-shadow 0.2s; }
.checklist-accordion-item:hover { box-shadow: var(--card-shadow); }
.checklist-header { width: 100%; display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.5rem; background: none; border: none; cursor: pointer; text-align: left; font-size: 1.1rem; font-weight: 600; }
.checklist-header span { flex-grow: 1; }
.checklist-header.passed { color: var(--success-color); }
.checklist-header.failed { color: var(--danger-color); }
.checklist-header .accordion-icon { transition: transform 0.3s ease-in-out; color: var(--gray-500); }
.checklist-accordion-item.active .checklist-header .accordion-icon { transform: rotate(180deg); }

/* THIS IS THE CRITICAL PART FOR THE ACCORDION ANIMATION */
.checklist-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
    padding: 0 1.5rem; /* No padding when closed */
}
.checklist-accordion-item.active .checklist-content {
    padding: 0 1.5rem 1.5rem; /* Add padding back when open */
}

.insight-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; padding-top: 1rem; border-top: 1px solid var(--gray-200); }
.insight-pill { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.9rem; font-weight: 500; }
.insight-pill .feather { width: 16px; height: 16px; }
.insight-pill.passed { background-color: #f0fdf4; color: #15803d; }
.insight-pill.failed { background-color: #fef2f2; color: #b91c1c; }
.no-items-in-list { font-style: italic; color: var(--gray-500); padding: 1rem; }

/* --- 5. DETAILED TABLES & RESPONSIVE --- */
.results-table-container { overflow-x: auto; border: 1px solid var(--gray-200); border-radius: 0.75rem; margin-top: 2rem; background-color: var(--white-color); }
@media (max-width: 1024px) {
    .analytics-dashboard { grid-template-columns: 1fr; }
    .main-score-card { grid-row: auto; }
}
@media (max-width: 768px) {
    .page-content { margin-top: 1rem; }
    .analytics-dashboard { gap: 1rem; }
    .main-score-value { font-size: 4rem; }
    .insight-cards-wrapper { grid-template-columns: 1fr; }
    .results-table thead { display: none; }
    .results-table, .results-table tbody, .results-table tr, .results-table td { display: block; width: 100%; }
    .results-table tr { border-bottom: 2px solid var(--gray-200); margin-bottom: 1rem; }
    .results-table td { display: flex; justify-content: space-between; align-items: center; text-align: right; padding: 0.75rem 1rem; border: none; }
    .results-table td::before { content: attr(data-label); font-weight: bold; text-align: left; padding-right: 1rem; }
}



    :root {
        --clarity-bg: #f7f9fc;
        --clarity-card-bg: #ffffff;
        --clarity-primary: #007aff;
        --clarity-success: #34c759;
        --clarity-text-main: #2c3e50;
        --clarity-text-secondary: #8a9bad;
        --clarity-border: #e9ecef;
    }



    .page-container {
        max-width: 800px;
        margin: 0 auto;
        padding: 2rem 1rem;
    }
    .page-header {
        text-align: center;
        margin-bottom: 2.5rem;
        border-bottom: 1px solid var(--clarity-border);
        padding-bottom: 1.5rem;
    }
    .page-header h1 { font-size: 2rem; margin: 0; }

    /* --- Loader and Results Styling --- */
    #loader-section {
        opacity: 1;
        transition: opacity 0.6s ease-out; /* Smooth fade-out transition */
        max-height: 1000px; /* For smooth disappearance */
        overflow: hidden;
    }
    #loader-section.fade-out {
        opacity: 0;
        max-height: 0;
        padding: 0;
        margin: 0;
        transition: opacity 0.6s ease-out, max-height 0.8s ease-in, padding 0.8s, margin 0.8s;
    }
    #results-section.hidden {
        display: none;
    }

    .clarity-loader-card {
        max-width: 500px;
        margin: 0 auto;
        background: var(--clarity-card-bg);
        border-radius: 16px;
        padding: 2rem;
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.06);
        display: flex; flex-direction: column; gap: 1.5rem;
    }
    .clarity-header h2 { margin: 0; font-size: 1.5rem; font-weight: 700; }
    #clarity-status-text {
        margin-top: 0.5rem; color: var(--clarity-text-secondary);
        font-size: 0.95rem; min-height: 1.2em;
    }
    .clarity-progress-wrapper { display: flex; align-items: center; gap: 1rem; }
    #clarity-progress-bar {
        flex-grow: 1; height: 8px; background-color: var(--clarity-border);
        border-radius: 4px; overflow: hidden;
    }
    #clarity-progress-fill {
        width: 0; height: 100%; background-color: var(--clarity-primary);
        border-radius: 4px; transition: width 0.4s ease-out, background-color 0.4s ease;
    }
    #clarity-percentage {
        font-size: 0.9rem; font-weight: 700; color: var(--clarity-primary);
        flex-shrink: 0; transition: color 0.4s ease;
    }
    #clarity-checklist {
        display: flex; flex-direction: column; gap: 1rem;
        border-top: 1px solid var(--clarity-border); padding-top: 1.5rem;
    }
    .clarity-item {
        display: flex; align-items: center; gap: 1rem;
        color: var(--clarity-text-secondary); font-size: 0.95rem;
        transition: color 0.4s ease;
    }
    .status-icon {
        width: 20px; height: 20px; flex-shrink: 0;
        background-color: #bdc7d3;
        transition: all 0.4s ease;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3C/svg%3E") center/contain no-repeat;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3C/svg%3E") center/contain no-repeat;
    }
    /* CORRECTED PROCESSING ICON */
    .clarity-item.processing { color: var(--clarity-text-main); }
    .clarity-item.processing .status-icon {
        background-color: var(--clarity-primary);
        animation: spin 1s linear infinite;
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='2' x2='12' y2='6'%3E%3C/line%3E%3Cline x1='12' y1='18' x2='12' y2='22'%3E%3C/line%3E%3Cline x1='4.93' y1='4.93' x2='7.76' y2='7.76'%3E%3C/line%3E%3Cline x1='16.24' y1='16.24' x2='19.07' y2='19.07'%3E%3C/line%3E%3Cline x1='2' y1='12' x2='6' y2='12'%3E%3C/line%3E%3Cline x1='18' y1='12' x2='22' y2='12'%3E%3C/line%3E%3Cline x1='4.93' y1='19.07' x2='7.76' y2='16.24'%3E%3C/line%3E%3Cline x1='16.24' y1='7.76' x2='19.07' y2='4.93'%3E%3C/line%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='2' x2='12' y2='6'%3E%3C/line%3E%3Cline x1='12' y1='18' x2='12' y2='22'%3E%3C/line%3E%3Cline x1='4.93' y1='4.93' x2='7.76' y2='7.76'%3E%3C/line%3E%3Cline x1='16.24' y1='16.24' x2='19.07' y2='19.07'%3E%3C/line%3E%3Cline x1='2' y1='12' x2='6' y2='12'%3E%3C/line%3E%3Cline x1='18' y1='12' x2='22' y2='12'%3E%3C/line%3E%3Cline x1='4.93' y1='19.07' x2='7.76' y2='16.24'%3E%3C/line%3E%3Cline x1='16.24' y1='7.76' x2='19.07' y2='4.93'%3E%3C/line%3E%3C/svg%3E");
    }
    @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

    .clarity-item.done .status-icon {
        background-color: var(--clarity-success);
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E");
    }
    .clarity-loader-card.finished #clarity-progress-fill { background-color: var(--clarity-success); }
    .clarity-loader-card.finished #clarity-percentage { color: var(--clarity-success); }

    
