/* EditMe Health Check - Main Stylesheet */

:root {
    --primary: #ff3f00;
    --primary-dark: #cc3200;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.emhc-icon {
    width: 1.1em;
    height: 1.1em;
    vertical-align: middle;
    fill: currentColor;
    flex-shrink: 0;
}

.emhc-icon-spin {
    animation: spin 1s linear infinite;
}

.emhc-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.emhc-header {
    text-align: center;
    margin-bottom: 40px;
}

.emhc-rich-text {
    white-space: pre-line;
}

.emhc-rich-text>*:first-child {
    margin-top: 0;
}

.emhc-rich-text>*:last-child {
    margin-bottom: 0;
}

.emhc-header h1 {
    font-size: 2.5em;
    color: var(--primary);
    margin-bottom: 10px;
}

.emhc-header p {
    font-size: 1.2em;
    color: #666;
}

.emhc-header-copy :is(h1, h2, h3, h4, h5, h6, p) {
    color: var(--primary);
}

.emhc-header-copy :is(h1, h2) {
    font-size: 2.5em;
    line-height: 1.1;
    margin-bottom: 10px;
}

.emhc-header-copy :is(h3, h4, h5, h6) {
    font-size: 1.8em;
    line-height: 1.2;
    margin-bottom: 10px;
}

.emhc-header-copy p+p,
.emhc-header-copy h1+p,
.emhc-header-copy h2+p,
.emhc-header-copy h3+p,
.emhc-header-copy h4+p,
.emhc-header-copy h5+p,
.emhc-header-copy h6+p {
    font-size: 1.2em;
    color: #666;
}

.emhc-section {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* Form Section */
.emhc-input-group {
    display: flex;
    gap: 10px;
    max-width: 700px;
    margin: 0 auto;
}

.emhc-input-group input {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.3s;
}

.emhc-input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.emhc-input-group button {
    padding: 15px 30px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.emhc-input-group button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.emhc-input-group button .emhc-icon,
#emhc-download-form button .emhc-icon,
.emhc-full-report-btn .emhc-icon {
    margin-right: 8px;
}

.emhc-help-text {
    text-align: center;
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

/* Loading Section */
.emhc-loader {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--light);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Hide the verbose loading status text to avoid layout shifts
   while still allowing screen readers to access the content. */
#emhc-loading-message {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#emhc-analyzing-url {
    color: var(--primary);
    font-weight: bold;
}

.emhc-progress-bars {
    max-width: 600px;
    margin: 30px auto 0;
}

.progress-item {
    display: none;
    margin-bottom: 15px;
    padding: 10px;
    background: var(--light);
    border-radius: 8px;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.progress-item.active {
    opacity: 1;
}

.progress-item.complete {
    opacity: 1;
    background: #e7f5e9;
}

.progress-item .emhc-icon {
    margin-right: 10px;
    color: var(--primary);
}

.progress-bar {
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: var(--gradient);
    transition: width 0.5s ease;
}

/* Results Section */
.emhc-score-card {
    text-align: center;
    padding: 40px;
    background: var(--gradient);
    color: white;
    border-radius: 12px;
    margin-bottom: 30px;
}

.score-circle {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: bold;
}

.score-label {
    font-size: 24px;
    opacity: 0.8;
}

#emhc-grade {
    font-size: 2em;
    margin: 10px 0;
}

#emhc-grade .emhc-grade-stars {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

#emhc-grade .emhc-grade-stars .emhc-icon {
    color: #ffd54f;
    width: 1.2em;
    height: 1.2em;
}

.emhc-locked-report {
    margin: 10px auto 0;
    max-width: 720px;
    font-size: 16px;
    line-height: 1.5;
}

.emhc-locked-report.unlocked {
    color: var(--success);
    font-weight: 600;
}

.emhc-charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.chart-container {
    background: var(--light);
    padding: 20px;
    border-radius: 12px;
}

/* Check Results */
#emhc-onpage-report {
    margin-top: 30px;
    padding: 24px;
    border-radius: 12px;

}

#emhc-checks-results {
    display: grid;
    gap: 20px;
}

.page-result {
    background: #fdfdfd;
    border-radius: 12px;
    padding: 20px;
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.page-header h3 {
    margin: 0;
    word-break: break-word;
}

.page-score {
    margin: 0;
    font-weight: 700;
    color: var(--primary);
}

.check-card {
    background: var(--light);
    border-radius: 12px;
    padding: 25px;
    border-left: 4px solid var(--info);
    margin-bottom: 10px;
}

.check-card.passed {
    border-left-color: var(--success);
}

.check-card.failed {
    border-left-color: var(--danger);
}

.check-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 10px 0;
    width: 100%;
}

.check-header__top {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.check-header h4 {
    margin: 0;
}

.check-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.check-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding: 8px 12px;
    border: 1px solid #d6dbe6;
    border-radius: 999px;
    background: #fff;
    color: #2f3c55;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.check-toggle:hover {
    background: #f3f6fb;
    border-color: #bec8d8;
    transform: translateY(-1px);
}

.check-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.check-toggle__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #eef2f7;
    font-size: 15px;
    font-weight: 700;
}

.check-card.is-collapsed .check-toggle__icon {
    background: #e6f6ed;
    color: #1b8c52;
}

.check-card.failed .check-toggle {
    border-color: #f1c3ca;
}

.check-details {
    width: 100%;
}

.check-score {
    font-size: 1.1em;
    font-weight: bold;
}

.check-findings {
    margin: 15px 0;
}

.finding-item {
    padding: 8px;
    margin: 5px 0;
    border-radius: 6px;
    font-size: 14px;
}

.finding-item.pass {
    background: #d4edda;
    color: #155724;
}

.finding-item.fail {
    background: #f8d7da;
    color: #721c24;
}

.finding-item.partial {
    background: #fff3cd;
    color: #856404;
}

.recommendations {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.recommendations h4 {
    margin: 0 0 10px 0;
    color: var(--primary);
}

.recommendations ul {
    margin: 0;
    padding-left: 20px;
}

.recommendations li {
    margin: 5px 0;
}

.priority-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.priority-critical {
    background: var(--danger);
    color: white;
}

.priority-high {
    background: var(--warning);
    color: #000;
}

.priority-medium {
    background: var(--info);
    color: white;
}

.priority-low {
    background: var(--success);
    color: white;
}

/* Download Section */
.emhc-download-section {
    background: var(--light);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    margin-top: 40px;
}

.emhc-download-section h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

.emhc-download-copy {
    white-space: pre-line;
}

.emhc-download-copy :is(h1, h2, h3, h4, h5, h6) {
    color: inherit;
    margin-bottom: 10px;
}

.emhc-download-copy :is(h1, h2, h3) {
    font-size: 1.75em;
}

.emhc-download-copy p+p,
.emhc-download-copy h1+p,
.emhc-download-copy h2+p,
.emhc-download-copy h3+p,
.emhc-download-copy h4+p,
.emhc-download-copy h5+p,
.emhc-download-copy h6+p {
    color: #444;
}

#emhc-download-form {
    max-width: 500px;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#emhc-download-form input {
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

#emhc-download-form button {
    padding: 15px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

#emhc-download-form button:hover {
    background: #218838;
}

/* Download Section */
.emhc-full-report-section {
    background: var(--light);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    margin-top: 40px;
}

.emhc-full-report-section h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

.emhc-full-report-note {
    margin-top: 10px;
    color: #333;
    font-weight: 600;
    white-space: pre-line;
    text-align: left;
}

.emhc-full-report-form {
    margin-top:30px;
    display: inline-block;
    width: 100%;
    text-align: left;
}

.emhc-full-report-form .wpcf7-form label {
  color: #444;
}

.emhc-full-report-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
    padding: 12px 20px;
    font-weight: bold;
    color: white;
    background: var(--primary);
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.2s ease;
}

.emhc-full-report-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.privacy-note {
    font-size: 12px;
    color: #666;
    margin-top: 15px;
}

#emhc-pdf-status {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
}

#emhc-pdf-status .emhc-icon {
    margin-right: 8px;
}

#emhc-pdf-status.success {
    background: #d4edda;
    color: #155724;
}

#emhc-pdf-status.error {
    background: #f8d7da;
    color: #721c24;
}

.emhc-unlocked-note {
    margin: 0 0 15px 0;
    font-weight: 500;
    color: #444;
}

.emhc-dashboard {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-top: 10px;
}

.emhc-dashboard__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.emhc-dashboard__access {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.emhc-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2f7;
    color: #2f3c55;
    font-size: 13px;
}

.emhc-badge--success {
    background: #e6f6ed;
    color: #1b8c52;
}

.emhc-report-card {
    border: 1px solid #e4e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.emhc-report-card__head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.emhc-report-card__label {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.emhc-report-card__meta {
    color: #6b7280;
    margin-top: 4px;
}

.emhc-report-card__summary {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.emhc-report-card__actions .button {
    margin-left: 6px;
}

.emhc-stat__label {
    display: block;
    font-size: 12px;
    color: #6b7280;
}

.emhc-stat__value {
    font-size: 20px;
    font-weight: 700;
}

.emhc-report-card__body {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
}

.emhc-report-card__nav ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.emhc-report-card__nav li {
    margin-bottom: 6px;
}

.emhc-report-card__nav a {
    color: #0f64f2;
    text-decoration: none;
}

.emhc-report-card__nav a:hover {
    text-decoration: underline;
}

.emhc-report-page {
    border: 1px solid #eef2f7;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    background: #fafbfc;
}

.emhc-report-page__header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.emhc-report-page__checks {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

.emhc-check-chip {
    border: 1px solid #e6ebf4;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
}

.emhc-check-chip__score {
    display: inline-block;
    margin-left: 6px;
    color: #6b7280;
}

.emhc-check-chip__note {
    margin: 6px 0 0;
    color: #444;
}

/* Responsive */
@media (max-width: 768px) {
    .emhc-input-group {
        flex-direction: column;
    }

    .check-header__top {
        flex-direction: column;
        align-items: stretch;
    }

    .check-toggle {
        margin-left: 0;
        justify-content: center;
    }

    .emhc-dashboard__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .emhc-report-card__body {
        grid-template-columns: 1fr;
    }

    .emhc-coupon__fields {
        grid-template-columns: 1fr;
    }

    .emhc-header h1 {
        font-size: 1.8em;
    }

    .score-circle {
        width: 150px;
        height: 150px;
    }

    .score-text {
        font-size: 36px;
    }

    .emhc-charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .emhc-container {
        padding: 0 12px;
        margin: 20px auto;
    }

    .emhc-section {
        padding: 24px 18px;
    }

    .emhc-score-card {
        padding: 30px 18px;
    }

    #emhc-onpage-report {
        padding: 20px;
    }

    .check-card {
        padding: 18px;
    }

    .page-header h3 {
        font-size: 1.05em;
    }
}