/**
 * SeoCategory Plugin Frontend Styles
 * Self-contained & Theme-Independent
 * Package: Plugin\SeoCategory
 */

/* ==========================================================================
   0. Box Sizing & Element Isolation
   ========================================================================== */
.ec-category-seo-top,
.ec-category-seo-top *,
.ec-category-seo-top *::before,
.ec-category-seo-top *::after,
.ec-category-seo-bottom,
.ec-category-seo-bottom *,
.ec-category-seo-bottom *::before,
.ec-category-seo-bottom *::after {
    box-sizing: border-box;
}

/* Hide containers completely if empty */
.ec-category-seo-top:empty,
.ec-category-banner:empty,
.ec-category-top-desc:empty,
.ec-category-seo-bottom:empty,
.ec-category-seo-bottom__content:empty {
    display: none;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
}

/* ==========================================================================
   1. Category Top Banner & Description Area
   ========================================================================== */
.ec-category-seo-top {
    margin-top: 0;
    margin-bottom: 28px;
    width: 100%;
    clear: both;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
}

.ec-category-banner {
    width: 100%;
    margin-bottom: 18px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8fafc;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ec-category-banner img {
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: cover;
    display: block;
    border: 0;
    margin: 0;
    padding: 0;
    vertical-align: middle;
}

.ec-category-top-desc {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px 20px;
    font-size: 15px;
    line-height: 1.7;
    color: #495057;
    margin-bottom: 0;
}

.ec-category-top-desc>*:first-child {
    margin-top: 0;
}

.ec-category-top-desc>*:last-child {
    margin-bottom: 0;
}

.ec-category-top-desc p {
    margin: 0 0 12px 0;
    line-height: 1.7;
}

.ec-category-top-desc a {
    color: #0d6efd;
    text-decoration: underline;
}

.ec-category-top-desc a:hover {
    color: #0a58ca;
}

/* ==========================================================================
   2. Category Bottom Detailed SEO Article Area
   ========================================================================== */
.ec-category-seo-bottom {
    margin-top: 48px;
    margin-bottom: 40px;
    padding: 28px 32px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    font-size: 15px;
    line-height: 1.8;
    color: #2d3748;
    clear: both;
}

.ec-category-seo-bottom__content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ec-category-seo-bottom__content>*:first-child {
    margin-top: 0;
}

.ec-category-seo-bottom__content>*:last-child {
    margin-bottom: 0;
}

/* Headings inside Bottom SEO Area */
.ec-category-seo-bottom__content h1,
.ec-category-seo-bottom__content h2,
.ec-category-seo-bottom__content h3,
.ec-category-seo-bottom__content h4,
.ec-category-seo-bottom__content h5,
.ec-category-seo-bottom__content h6 {
    color: #1a202c;
    font-weight: 700;
    line-height: 1.4;
    margin-top: 28px;
    margin-bottom: 14px;
}

.ec-category-seo-bottom__content h1 {
    font-size: 1.5rem;
    padding-bottom: 10px;
    border-bottom: 2px solid #0d6efd;
}

.ec-category-seo-bottom__content h2 {
    font-size: 1.35rem;
    padding-bottom: 8px;
    border-bottom: 2px solid #0d6efd;
    margin-top: 32px;
}

.ec-category-seo-bottom__content h3 {
    font-size: 1.15rem;
    padding-left: 12px;
    border-left: 4px solid #0d6efd;
    margin-top: 24px;
}

.ec-category-seo-bottom__content h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 20px;
}

.ec-category-seo-bottom__content p {
    margin: 0 0 16px 0;
    line-height: 1.8;
}

/* Lists */
.ec-category-seo-bottom__content ul,
.ec-category-seo-bottom__content ol {
    margin: 0 0 18px 0;
    padding-left: 28px;
}

.ec-category-seo-bottom__content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

/* Links */
.ec-category-seo-bottom__content a {
    color: #0d6efd;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.ec-category-seo-bottom__content a:hover {
    color: #0a58ca;
}

/* Tables */
.ec-category-seo-bottom__content table {
    width: 100%;
    margin: 16px 0 24px 0;
    border-collapse: collapse;
    font-size: 14px;
    background-color: #ffffff;
}

.ec-category-seo-bottom__content table th,
.ec-category-seo-bottom__content table td {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}

.ec-category-seo-bottom__content table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #1a202c;
}

.ec-category-seo-bottom__content table tr:nth-child(even) td {
    background-color: #fcfdfe;
}

/* Blockquotes */
.ec-category-seo-bottom__content blockquote {
    margin: 20px 0;
    padding: 16px 20px;
    background-color: #f8fafc;
    border-left: 4px solid #94a3b8;
    color: #475569;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

.ec-category-seo-bottom__content blockquote p:last-child {
    margin-bottom: 0;
}

/* Horizontal Rule */
.ec-category-seo-bottom__content hr {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 24px 0;
}

/* Code & Pre */
.ec-category-seo-bottom__content code {
    background-color: #f1f5f9;
    color: #e11d48;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: monospace;
}

.ec-category-seo-bottom__content pre {
    background-color: #1e293b;
    color: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

/* ==========================================================================
   3. Responsive Adjustments (Theme Agnostic)
   ========================================================================== */
@media screen and (max-width: 768px) {
    .ec-category-seo-top {
        margin-bottom: 20px;
    }

    .ec-category-banner img {
        max-height: 240px;
    }

    .ec-category-top-desc {
        padding: 14px 16px;
        font-size: 14px;
    }

    .ec-category-seo-bottom {
        margin-top: 32px;
        margin-bottom: 28px;
        padding: 20px 16px;
        font-size: 14px;
        border-radius: 8px;
    }

    .ec-category-seo-bottom__content h1 {
        font-size: 1.3rem;
    }

    .ec-category-seo-bottom__content h2 {
        font-size: 1.2rem;
    }

    .ec-category-seo-bottom__content h3 {
        font-size: 1.05rem;
    }

    .ec-category-seo-bottom__content table th,
    .ec-category-seo-bottom__content table td {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* ==========================================================================
   4. Admin SEO Audit & Google SERP Preview Styles (Yoast / RankMath Style)
   ========================================================================== */
.seo-audit-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.seo-audit-score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ffffff;
    margin: 0 auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.seo-score-good {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.seo-score-ok {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.seo-score-bad {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.seo-serp-preview {
    background: #ffffff;
    border: 1px solid #dfe1e5;
    border-radius: 8px;
    padding: 16px 20px;
    font-family: Arial, sans-serif;
    max-width: 650px;
}

.seo-serp-url {
    font-size: 14px;
    line-height: 1.3;
    color: #202124;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.seo-serp-url cite {
    color: #202124;
    font-style: normal;
    font-size: 13px;
}

.seo-serp-title {
    font-size: 20px;
    line-height: 1.3;
    color: #1a0dab;
    text-decoration: none;
    cursor: pointer;
    font-weight: 400;
    margin-bottom: 6px;
    display: block;
    word-break: break-word;
}

.seo-serp-title:hover {
    text-decoration: underline;
}

.seo-serp-snippet {
    font-size: 14px;
    line-height: 1.58;
    color: #4d5156;
    word-break: break-word;
    margin: 0;
}

.seo-char-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}
