/**
 * WP Site Performance Detection - HTTP Headers Styles v1.0.0
 */

/* ==================== Container ==================== */
.wp-spd-hh-container {
    max-width: 960px;
    margin: 0 auto;
    color: #1e1e1e;
    line-height: 1.6;
}

.wp-spd-hh-container * {
    box-sizing: border-box;
}

/* ==================== Search Form ==================== */
.wp-spd-hh-form {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.wp-spd-hh-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.wp-spd-hh-url-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
    outline: none;
}

.wp-spd-hh-url-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34,113,177,0.12);
}

.wp-spd-hh-submit-btn {
    padding: 14px 32px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.wp-spd-hh-submit-btn:hover { background: #135e96; }
.wp-spd-hh-submit-btn:disabled { background: #a7aaad; cursor: not-allowed; }

/* ==================== Messages ==================== */
.wp-spd-hh-error {
    background: #fcf0f1;
    border: 1px solid #d63638;
    color: #d63638;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* ==================== Loading ==================== */
.wp-spd-hh-loading {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 20px;
}

.wp-spd-hh-loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: wp-spd-hh-spin 0.7s linear infinite;
    margin: 0 auto 14px;
}

@keyframes wp-spd-hh-spin { to { transform: rotate(360deg); } }

.wp-spd-hh-loading p { color: #646970; font-size: 15px; margin: 0; }

/* ==================== Results ==================== */
.wp-spd-hh-results { display: none; }
.wp-spd-hh-results.visible { display: block; }

/* ==================== Section Common ==================== */
.wp-spd-hh-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
}

.wp-spd-hh-section-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    color: #1e1e1e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wp-spd-hh-section-title svg {
    flex-shrink: 0;
    color: #2271b1;
}

/* ==================== Key Headers Grid ==================== */
.wp-spd-hh-key-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 10px;
}

.wp-spd-hh-header-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 13px;
    transition: background 0.15s;
    gap: 12px;
}

.wp-spd-hh-header-item:hover {
    background: #fafafa;
}

.wp-spd-hh-hi-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.wp-spd-hh-hi-name {
    font-weight: 600;
    color: #3c434a;
    white-space: nowrap;
    flex-shrink: 0;
}

.wp-spd-hh-hi-label {
    color: #949aa0;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
}

.wp-spd-hh-hi-right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    justify-content: flex-end;
    flex-shrink: 0;
}

.wp-spd-hh-hi-value {
    color: #1e1e1e;
    font-family: inherit;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
    text-align: right;
}

/* Status badge */
.wp-spd-hh-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.wp-spd-hh-badge.pass { background: #edfaef; color: #00a32a; }
.wp-spd-hh-badge.warning { background: #fcf9e8; color: #bd8600; }
.wp-spd-hh-badge.fail { background: #fcf0f1; color: #d63638; }
.wp-spd-hh-badge.info { background: #f0f6fc; color: #2271b1; }

/* ==================== Fingerprint List ==================== */
.wp-spd-hh-fp-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wp-spd-hh-fp-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    transition: box-shadow 0.15s;
}

.wp-spd-hh-fp-item:hover {
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.wp-spd-hh-fp-icon {
    width: 26px; height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.wp-spd-hh-fp-icon.pass { color: #00a32a; }
.wp-spd-hh-fp-icon.warning { color: #dba617; }
.wp-spd-hh-fp-icon.fail { color: #d63638; }
.wp-spd-hh-fp-icon.info { color: #2271b1; }

.wp-spd-hh-fp-body {
    flex: 1;
    min-width: 0;
    color: #1e1e1e;
}

.wp-spd-hh-fp-label {
    font-weight: 600;
    color: #1e1e1e;
    margin-bottom: 2px;
}

.wp-spd-hh-fp-detail {
    color: #3c434a;
    font-size: 12px;
}

.wp-spd-hh-fp-msg {
    color: #787c82;
    font-size: 11.5px;
    margin-top: 3px;
    line-height: 1.45;
}

.wp-spd-hh-fp-extra {
    margin-top: 4px;
    font-size: 11px;
    color: #646970;
    word-break: break-all;
}

/* ==================== Ad Slot ==================== */
.wp-spd-hh-ad-slot {
    background: #f8f9fa;
    border: 1px dashed #c3c4c7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-spd-hh-ad-slot::before {
    content: "Ad";
    color: #a7aaad;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.wp-spd-hh-ad-active {
    background: transparent;
    border-style: solid;
    border-color: #e0e0e0;
    display: block;
    min-height: auto;
}

.wp-spd-hh-ad-active::before {
    content: none;
}

/* ==================== Security Score Card ==================== */
.wp-spd-hh-score-card {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 20px;
    background: linear-gradient(135deg, #f6f9fc 0%, #fff 100%);
    border: 1px solid #e0e0e0;
    border-radius: 10px;
}

.wp-spd-hh-score-circle-wrap {
    position: relative;
    width: 110px; height: 110px;
    flex-shrink: 0;
}

.wp-spd-hh-score-circle-svg { transform: rotate(-90deg); }

.wp-spd-hh-score-circle-bg { fill: none; stroke: #e8e8e8; stroke-width: 8; }
.wp-spd-hh-score-circle-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s ease, stroke 0.3s;
}

.wp-spd-hh-score-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: 800;
}

.wp-spd-hh-score-info {
    flex: 1;
}

.wp-spd-hh-grade-letter {
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.wp-spd-hh-grade-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.wp-spd-hh-score-breakdown {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
}

.wp-spd-hh-score-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wp-spd-hh-score-stat-val { font-weight: 700; }
.wp-spd-hh-score-stat.pass-color { color: #00a32a; }
.wp-spd-hh-score-stat.warn-color { color: #dba617; }
.wp-spd-hh-score-stat.fail-color { color: #d63638; }

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .wp-spd-hh-container {
        max-width: 100%;
        padding: 0 12px;
        overflow-x: hidden;
    }
    .wp-spd-hh-form { padding: 16px; }
    .wp-spd-hh-input-group { flex-direction: column; }
    .wp-spd-hh-submit-btn { width: 100%; }
    .wp-spd-hh-key-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .wp-spd-hh-section {
        padding: 16px 14px;
        border-radius: 8px;
        margin-bottom: 16px;
    }
    .wp-spd-hh-header-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 12px;
    }
    .wp-spd-hh-hi-left {
        width: 100%;
    }
    .wp-spd-hh-hi-right {
        width: 100%;
        justify-content: flex-start;
    }
    .wp-spd-hh-hi-name { font-size: 13px; }
    .wp-spd-hh-hi-label { font-size: 10px; }
    .wp-spd-hh-hi-value {
        max-width: 100%;
        font-size: 11px;
        white-space: normal;
        word-break: break-all;
        text-align: left;
    }
    .wp-spd-hh-fp-item {
        flex-direction: row;
        padding: 10px 12px;
        gap: 10px;
    }
    .wp-spd-hh-fp-body {
        min-width: 0;
        overflow-wrap: break-word;
    }
    .wp-spd-hh-fp-detail,
    .wp-spd-hh-fp-msg {
        word-break: break-word;
    }
    .wp-spd-hh-score-card {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }
    .wp-spd-hh-score-circle-wrap {
        width: 90px;
        height: 90px;
    }
    .wp-spd-hh-score-text {
        font-size: 24px;
    }
    .wp-spd-hh-grade-letter {
        font-size: 36px;
    }
    .wp-spd-hh-score-breakdown {
        justify-content: center;
        font-size: 12px;
    }
    /* Prevent any horizontal overflow */
    .wp-spd-hh-section-title {
        font-size: 15px;
        flex-wrap: wrap;
    }
    .wp-spd-hh-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .wp-spd-hh-container {
        padding: 0 8px;
    }
    .wp-spd-hh-form {
        padding: 14px 12px;
    }
    .wp-spd-hh-url-input {
        font-size: 15px;
        padding: 12px 14px;
    }
    .wp-spd-hh-submit-btn {
        padding: 12px 24px;
        font-size: 15px;
    }
    .wp-spd-hh-header-item {
        padding: 8px 10px;
    }
    .wp-spd-hh-hi-value {
        font-size: 10px;
    }
    .wp-spd-hh-ad-slot {
        padding: 16px;
        min-height: 70px;
    }
}

/* ==================== Content Section (SEO Article) ==================== */
.wp-spd-hh-content {
    margin-top: 8px;
}

.wp-spd-hh-content-section {
    margin-bottom: 32px;
}

.wp-spd-hh-content-section:last-child {
    margin-bottom: 0;
}

.wp-spd-hh-content-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e1e1e;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    line-height: 1.3;
}

.wp-spd-hh-content-subtitle {
    font-size: 15px;
    color: #50575e;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Checklists */
.wp-spd-hh-checklist {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.wp-spd-hh-checklist li {
    padding: 8px 0 8px 28px;
    position: relative;
    font-size: 14.5px;
    line-height: 1.6;
    color: #3c434a;
}

.wp-spd-hh-checklist-danger li::before {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands";
    font-weight: 900;
    content: "\f071";
    position: absolute;
    left: 0;
    top: 7px;
    color: #d63638;
}

/* Feature Grid */
.wp-spd-hh-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.wp-spd-hh-feature-card {
    background: #fafbfc;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 22px 20px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.wp-spd-hh-feature-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.wp-spd-hh-feature-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    color: #fff;
    font-size: 22px;
}

.wp-spd-hh-feature-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1e1e1e;
}

.wp-spd-hh-feature-card p {
    font-size: 13.5px;
    color: #50575e;
    line-height: 1.6;
    margin: 0;
}

/* Accordion / Details */
.wp-spd-hh-accordion {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    background: #fff;
}

.wp-spd-hh-accordion:last-child {
    margin-bottom: 0;
}

.wp-spd-hh-accordion[open] {
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.wp-spd-hh-accordion-summary {
    padding: 14px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    user-select: none;
    font-weight: 600;
    font-size: 14.5px;
    color: #1e1e1e;
    transition: background 0.15s;
}

.wp-spd-hh-accordion-summary:hover {
    background: #f6f7f7;
}

.wp-spd-hh-accordion-summary::-webkit-details-marker {
    display: none;
}

.wp-spd-hh-accordion-title {
    flex: 1;
}

.wp-spd-hh-accordion-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.wp-spd-hh-accordion-badge.pass { background: #edfaef; color: #00a32a; }
.wp-spd-hh-accordion-badge.warning { background: #fcf9e8; color: #bd8600; }
.wp-spd-hh-accordion-badge.info { background: #f0f6fc; color: #2271b1; }

.wp-spd-hh-accordion-body {
    padding: 0 18px 16px 18px;
    font-size: 13.5px;
    line-height: 1.7;
    color: #3c434a;
    border-top: 1px solid #f0f0f0;
    margin-top: 0;
}

.wp-spd-hh-accordion-body p {
    margin: 10px 0;
}

.wp-spd-hh-accordion-body ul,
.wp-spd-hh-accordion-body ol {
    padding-left: 20px;
    margin: 8px 0;
}

.wp-spd-hh-accordion-body li {
    margin-bottom: 4px;
}

.wp-spd-hh-accordion-body em {
    color: #787c82;
    font-style: italic;
}

.wp-spd-hh-accordion-body a {
    color: #2271b1;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
}

.wp-spd-hh-accordion-body a:hover {
    border-bottom-color: #2271b1;
}

/* Code Blocks */
.wp-spd-hh-code-block {
    display: block;
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 14px 16px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12.5px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    margin: 12px 0;
    word-break: normal;
}

.wp-spd-hh-accordion-body code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: inherit;
    font-size: 12.5px;
    color: #d73a49;
}

/* H3 sub-headings in content */
.wp-spd-hh-h3 {
    font-size: 17px;
    font-weight: 700;
    color: #1e1e1e;
    margin: 24px 0 12px 0;
}

/* Compare Table */
.wp-spd-hh-compare-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 13.5px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.wp-spd-hh-compare-table thead {
    background: #f6f7f7;
}

.wp-spd-hh-compare-table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #1e1e1e;
    border-bottom: 2px solid #e0e0e0;
}

.wp-spd-hh-compare-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
    color: #3c434a;
}

.wp-spd-hh-compose-table tr:last-child td {
    border-bottom: none;
}

.wp-spd-hh-compare-table tbody tr:hover {
    background: #fafbfc;
}

.wp-spd-hh-compare-table code {
    background: #f0f0f0;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
}

/* Fingerprint Item Content (article section) */
.wp-spd-hh-fingerprint-list {
    margin-top: 20px;
}

.wp-spd-hh-fp-item-content {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 20px 22px;
    margin-bottom: 14px;
    transition: box-shadow 0.15s;
}

.wp-spd-hh-fp-item-content:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.wp-spd-hh-fp-item-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 10px;
}

.wp-spd-hh-fp-num {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}

.wp-spd-hh-fp-item-header h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 3px 0;
    color: #1e1e1e;
}

.wp-spd-hh-fp-risk {
    font-size: 12.5px !important;
    color: #bd8600;
    margin: 0 !important;
    font-weight: 500;
}

.wp-spd-hh-fp-tip {
    background: #f0f6fc;
    border-left: 3px solid #2271b1;
    padding: 10px 14px;
    margin: 12px 0 0 0;
    font-size: 13px;
    color: #2271b1;
    border-radius: 0 6px 6px 0;
}

/* Pro Tip Box */
.wp-spd-hh-pro-tip {
    background: linear-gradient(135deg, #f6f9fc 0%, #edf5ff 100%);
    border: 1px solid #c4d8ef;
    border-radius: 10px;
    padding: 20px 24px;
    margin-top: 24px;
}

.wp-spd-hh-pro-tip h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #1e1e1e;
}

.wp-spd-hh-pro-tip p {
    font-size: 14px;
    color: #3c434a;
    line-height: 1.65;
    margin: 0;
}

.wp-spd-hh-pro-tip ol {
    padding-left: 20px;
    margin: 10px 0 0 0;
}

.wp-spd-hh-pro-tip li {
    margin-bottom: 6px;
    line-height: 1.55;
}

/* Recommendations Section */
.wp-spd-hh-recommendations {
    background: transparent;
    border-radius: 10px;
    padding: 28px 0;
    border: none;
}

.wp-spd-hh-rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.wp-spd-hh-rec-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 24px 20px;
    position: relative;
    transition: box-shadow 0.2s, transform 0.2s;
}

.wp-spd-hh-rec-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transform: translateY(-3px);
}

.wp-spd-hh-rec-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 10px;
    letter-spacing: 0.3px;
}

.wp-spd-hh-rec-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 8px 0 10px 0;
    color: #1e1e1e;
}

.wp-spd-hh-rec-desc {
    font-size: 13.5px;
    color: #50575e;
    line-height: 1.6;
    margin: 0 0 14px 0;
}

.wp-spd-hh-rec-link {
    display: inline-block;
    color: #2271b1;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 1px;
    transition: color 0.15s;
}

.wp-spd-hh-rec-link:hover {
    color: #135e96;
    border-bottom-color: #135e96;
}

/* Content Section Responsive */
@media (max-width: 768px) {
    .wp-spd-hh-content-title {
        font-size: 19px;
    }

    .wp-spd-hh-feature-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .wp-spd-hh-accordion-summary {
        padding: 12px 14px;
        font-size: 14px;
    }

    .wp-spd-hh-accordion-body {
        padding: 0 14px 14px 14px;
        font-size: 13px;
    }

    .wp-spd-hh-code-block {
        font-size: 11.5px;
        padding: 12px;
        overflow-x: auto;
    }

    .wp-spd-hh-compare-table {
        font-size: 12.5px;
    }

    .wp-spd-hh-compare-table th,
    .wp-spd-hh-compare-table td {
        padding: 8px 10px;
    }

    .wp-spd-hh-fp-item-content {
        padding: 16px 16px;
    }

    .wp-spd-hh-fp-item-header {
        flex-direction: column;
        gap: 8px;
    }

    .wp-spd-hh-rec-grid {
        grid-template-columns: 1fr;
    }

    .wp-spd-hh-recommendations {
        padding: 20px 0;
    }
    .wp-spd-hh-rec-card {
        padding: 20px 16px;
    }
}
