/* ============================================
   SEO AUDIT - Revolucy Design System
   ============================================ */

/* Form card */
.audit-form-card {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: 5px 6px 30px 0 var(--color-grey);
}

/* Error */
.alert-audit-error {
    background: #fff0f3;
    border: 1px solid var(--color-pink);
    border-radius: 10px;
}

/* Score section */
.audit-score-section {
    position: relative;
}

.score-ring-container {
    position: relative;
    width: 160px;
    height: 160px;
}

.score-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: #e8e8f0;
    stroke-width: 8;
}

.score-ring-fg {
    fill: none;
    stroke: var(--color-green);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out, stroke 0.3s;
}

.score-ring-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 42px;
    font-weight: 800;
    font-family: "Tektur", sans-serif;
}

/* Stat cards */
.audit-stat-card {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: 2px 3px 15px 0 var(--color-grey);
    padding: 15px 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.audit-stat-card .stat-number {
    font-size: 28px;
    color: var(--color-blue);
}

.audit-stat-card.passed .stat-number {
    color: #00c853;
}

.audit-stat-card.failed .stat-number {
    color: #f44336;
}

.audit-stat-card .stat-label {
    font-size: 12px;
    color: var(--color-dark-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* PDF button */
.btn-custom-blue {
    background: var(--color-blue);
    color: var(--color-white);
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-custom-blue:hover {
    background: #0614a0;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(8, 24, 175, 0.3);
}

/* Section titles */
.audit-section-title {
    font-size: 24px;
    border-bottom: 3px solid var(--color-green);
    padding-bottom: 8px;
    display: inline-block;
}

/* Priority actions */
.priority-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: #fff5f5;
    border-left: 4px solid #f44336;
    border-radius: 0 8px 8px 0;
    padding: 15px 20px;
    margin-bottom: 10px;
    transition: transform 0.2s;
}

.priority-card:hover {
    transform: translateX(4px);
}

.priority-card.warn {
    background: #fff8e1;
    border-left-color: #ff9800;
}

.priority-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
}

.priority-content {
    flex: 1;
}

.priority-label {
    font-size: 14px;
    color: var(--color-black);
}

.priority-hint {
    font-size: 12px;
    color: var(--color-dark-grey);
    margin-top: 2px;
}

.priority-reco {
    font-size: 13px;
    color: #555;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

/* Category bars */
.cat-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px 0;
}

.cat-bar-label {
    width: 180px;
    flex-shrink: 0;
    font-size: 13px;
    color: var(--color-black);
}

.cat-bar-track {
    flex: 1;
    height: 12px;
    background: #e8e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.cat-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease-out;
}

.cat-bar-score {
    width: 50px;
    text-align: right;
    font-size: 14px;
    flex-shrink: 0;
}

.cat-bar-detail {
    width: 60px;
    text-align: right;
    font-size: 11px;
    color: var(--color-dark-grey);
    flex-shrink: 0;
}

/* Keywords cloud */
.kw-tag {
    display: inline-block;
    background: #f0f2ff;
    color: var(--color-blue);
    padding: 5px 12px;
    border-radius: 20px;
    margin: 4px;
    font-weight: 500;
    transition: transform 0.2s, background 0.2s;
}

.kw-tag:hover {
    background: var(--color-blue);
    color: var(--color-white);
    transform: scale(1.05);
}

.kw-tag small {
    opacity: 0.7;
}

/* Detail accordion */
.audit-cat-card {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: 2px 3px 15px 0 var(--color-grey);
    margin-bottom: 12px;
    overflow: hidden;
}

.audit-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    gap: 10px;
}

.audit-cat-header:hover {
    background: #fafafe;
}

.audit-cat-header span:first-child {
    flex: 1;
    font-size: 15px;
    color: var(--color-black);
}

.audit-cat-badge {
    display: inline-block;
    color: var(--color-white);
    font-size: 13px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    min-width: 50px;
    text-align: center;
}

.audit-cat-chevron {
    font-size: 12px;
    color: var(--color-dark-grey);
    transition: transform 0.3s;
}

.audit-cat-header[aria-expanded="true"] .audit-cat-chevron {
    transform: rotate(180deg);
}

.audit-cat-body {
    padding: 0 20px 15px;
}

/* Check rows */
.check-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f5;
}

.check-row:last-child {
    border-bottom: none;
}

.check-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    line-height: 1.4;
}

.check-pass .check-icon { color: #00c853; }
.check-warn .check-icon { color: #ff9800; }
.check-fail .check-icon { color: #f44336; }

.check-content {
    flex: 1;
}

.check-label {
    font-size: 13px;
    color: var(--color-black);
    font-weight: 500;
}

.check-hint {
    font-size: 12px;
    color: var(--color-dark-grey);
    margin-top: 2px;
}

.check-reco {
    font-size: 12px;
    color: #555;
    margin-top: 4px;
    padding: 6px 10px;
    background: #fafafe;
    border-radius: 4px;
    border-left: 2px solid var(--color-blue);
}

/* Tech table */
.tech-table {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: 2px 3px 15px 0 var(--color-grey);
    overflow: hidden;
}

.tech-row {
    display: flex;
    border-bottom: 1px solid #f0f0f5;
}

.tech-row:last-child {
    border-bottom: none;
}

.tech-key {
    width: 180px;
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--color-blue);
    background: #fafafe;
}

.tech-val {
    flex: 1;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--color-black);
    word-break: break-all;
}

/* Headings tree */
.heading-item {
    padding: 6px 10px;
    border-left: 3px solid var(--color-green);
    margin-bottom: 4px;
    font-size: 13px;
    background: #fafafe;
    border-radius: 0 6px 6px 0;
}

.heading-item.h1 { margin-left: 0; border-left-color: var(--color-blue); font-weight: 600; }
.heading-item.h2 { margin-left: 20px; border-left-color: var(--color-green); }
.heading-item.h3 { margin-left: 40px; border-left-color: var(--color-purple); }
.heading-item.h4 { margin-left: 60px; border-left-color: var(--color-pink); }
.heading-item.h5 { margin-left: 80px; border-left-color: var(--color-dark-grey); }
.heading-item.h6 { margin-left: 100px; border-left-color: var(--color-grey); }

.heading-tag {
    display: inline-block;
    font-size: 11px;
    color: var(--color-white);
    background: var(--color-blue);
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 8px;
}

.heading-item.h2 .heading-tag { background: #2e7d32; }
.heading-item.h3 .heading-tag { background: var(--color-purple); }
.heading-item.h4 .heading-tag { background: var(--color-pink); }

/* ============================================
   PageSpeed Insights
   ============================================ */

/* PSI Tabs */
.psi-tabs {
    display: flex;
    gap: 8px;
}

.psi-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: 2px solid #e8e8f0;
    border-radius: 8px;
    background: var(--color-white);
    color: var(--color-dark-grey);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.psi-tab:hover {
    border-color: var(--color-blue);
    color: var(--color-blue);
}

.psi-tab.active {
    background: var(--color-blue);
    border-color: var(--color-blue);
    color: var(--color-white);
}

.psi-tab.active svg {
    stroke: var(--color-white);
}

/* PSI Scores Grid (gauges) */
.psi-scores-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.psi-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 130px;
}

.psi-gauge-svg {
    width: 90px;
    height: 90px;
}

.psi-gauge-value {
    font-size: 28px;
    margin-top: -58px;
    margin-bottom: 28px;
    line-height: 1;
}

.psi-gauge-label {
    font-size: 12px;
    color: var(--color-dark-grey);
    text-align: center;
    margin-top: 6px;
}

/* Core Web Vitals rows */
.cwv-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f5;
    background: var(--color-white);
}

.cwv-row:first-of-type {
    border-radius: 8px 8px 0 0;
}

.cwv-row:last-of-type {
    border-radius: 0 0 8px 8px;
    border-bottom: none;
}

.cwv-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.cwv-label {
    flex: 1;
    font-size: 13px;
    color: var(--color-black);
}

.cwv-value {
    font-size: 14px;
    flex-shrink: 0;
}

/* PSI Opportunities */
.psi-opp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid #f0f0f5;
    background: var(--color-white);
    font-size: 13px;
}

.psi-opp-row:first-of-type {
    border-radius: 8px 8px 0 0;
}

.psi-opp-row:last-of-type {
    border-radius: 0 0 8px 8px;
    border-bottom: none;
}

.psi-opp-title {
    flex: 1;
    color: var(--color-black);
}

.psi-opp-savings {
    flex-shrink: 0;
    font-weight: 600;
    color: #ff5722;
    font-size: 12px;
    background: #fff3e0;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .cat-bar-row {
        flex-wrap: wrap;
    }

    .cat-bar-label {
        width: 100%;
        margin-bottom: 4px;
    }

    .cat-bar-track {
        order: 1;
        flex: 1;
    }

    .cat-bar-score {
        order: 2;
    }

    .cat-bar-detail {
        order: 3;
    }

    .tech-row {
        flex-direction: column;
    }

    .tech-key {
        width: 100%;
    }

    .heading-item.h2 { margin-left: 10px; }
    .heading-item.h3 { margin-left: 20px; }
    .heading-item.h4 { margin-left: 30px; }
    .heading-item.h5 { margin-left: 40px; }
    .heading-item.h6 { margin-left: 50px; }

    .priority-card {
        flex-direction: column;
        gap: 8px;
    }

    .score-ring-container {
        width: 130px;
        height: 130px;
    }

    .score-ring-value {
        font-size: 34px;
    }

    .psi-scores-grid {
        gap: 12px;
    }

    .psi-gauge {
        width: 100px;
    }

    .psi-gauge-svg {
        width: 70px;
        height: 70px;
    }

    .psi-gauge-value {
        font-size: 22px;
        margin-top: -46px;
        margin-bottom: 22px;
    }

    .psi-tabs {
        flex-wrap: wrap;
    }

    .psi-tab {
        flex: 1;
        justify-content: center;
        padding: 8px 16px;
        font-size: 13px;
    }

    .cwv-row {
        flex-wrap: wrap;
    }

    .cwv-label {
        font-size: 12px;
    }
}
