/* AA SEO Optimize - Frontend Styles */

/* Enhanced Search Results */
.aa-search-results {
    margin: 20px 0;
}

.aa-search-section {
    margin-bottom: 30px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
}

.aa-search-section-header {
    background: #f8f9f9;
    padding: 15px 20px;
    border-bottom: 1px solid #e1e1e1;
}

.aa-search-section-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.aa-search-section-count {
    color: #50575e;
    font-size: 14px;
    margin-left: 8px;
}

.aa-search-section-content {
    padding: 0;
}

.aa-search-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f1;
    transition: background-color 0.2s ease;
}

.aa-search-item:last-child {
    border-bottom: none;
}

.aa-search-item:hover {
    background-color: #f8f9f9;
}

.aa-search-item-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 500;
}

.aa-search-item-title a {
    color: #2271b1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.aa-search-item-title a:hover {
    color: #135e96;
    text-decoration: underline;
}

.aa-search-item-excerpt {
    margin: 0 0 8px 0;
    color: #50575e;
    font-size: 14px;
    line-height: 1.5;
}

.aa-search-item-meta {
    font-size: 12px;
    color: #646970;
}

.aa-search-item-meta span {
    margin-right: 15px;
}

.aa-search-item-meta .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    margin-right: 4px;
    vertical-align: middle;
}

/* Internal Links */
.aa-internal-link {
    background: linear-gradient(to right, #2271b1 0%, #2271b1 100%);
    background-position: 0 100%;
    background-repeat: repeat-x;
    background-size: 1px 1px;
    color: #2271b1;
    text-decoration: none;
    transition: background-size 0.3s ease;
}

.aa-internal-link:hover {
    background-size: 1px 20px;
    color: #135e96;
}

/* SEO Highlights */
.aa-seo-highlight {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 2px 4px;
    font-weight: 500;
}

.aa-seo-highlight.important {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.aa-seo-highlight.success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* Content Quality Indicators */
.aa-quality-indicator {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aa-quality-indicator.excellent {
    background: #d4edda;
    color: #155724;
}

.aa-quality-indicator.good {
    background: #d1ecf1;
    color: #0c5460;
}

.aa-quality-indicator.average {
    background: #fff3cd;
    color: #856404;
}

.aa-quality-indicator.poor {
    background: #f8d7da;
    color: #721c24;
}

/* Reading Time */
.aa-reading-time {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    color: #646970;
}

.aa-reading-time .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 4px;
}

/* Content Score */
.aa-content-score {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #f8f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.aa-content-score.high {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.aa-content-score.medium {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.aa-content-score.low {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.aa-content-score .score-value {
    margin-left: 6px;
}

/* Tooltip */
.aa-seo-tooltip {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted #646970;
}

.aa-seo-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1d2327;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    animation: aaTooltipFadeIn 0.3s ease forwards;
}

@keyframes aaTooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Article Studio tables */
.aa-seo-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 1.2em 0;
    -webkit-overflow-scrolling: touch;
}

.aa-seo-generated-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    table-layout: fixed;
}

.aa-seo-generated-table th,
.aa-seo-generated-table td {
    overflow-wrap: anywhere;
    word-break: break-word;
    vertical-align: top;
}

/* Fallback for older generated posts without table wrappers/classes */
.aa-seo-article-studio-post table {
    width: 100%;
    table-layout: fixed;
}

.aa-seo-article-studio-post th,
.aa-seo-article-studio-post td {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* CTA blocks generated by Article Studio */
.aa-seo-cta-block {
    border-radius: 10px;
    padding: 16px 18px;
    margin: 1.2em 0;
    border: 1px solid #c3d4e6;
    background: linear-gradient(135deg, #f8fbff 0%, #edf5ff 100%);
}

.aa-seo-cta-style-sky {
    border-color: #b9d4f1;
    background: linear-gradient(135deg, #f7fbff 0%, #e9f4ff 100%);
}

.aa-seo-cta-style-mint {
    border-color: #b9e3d4;
    background: linear-gradient(135deg, #f6fffb 0%, #e7fbf3 100%);
}

.aa-seo-cta-style-sunset {
    border-color: #f1d1b9;
    background: linear-gradient(135deg, #fffaf7 0%, #fff0e7 100%);
}

.aa-seo-cta-banner,
.aa-seo-cta-copy,
.aa-seo-cta-actions {
    margin: 0 0 10px;
}

.aa-seo-cta-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.aa-seo-cta-button {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    background: #1f6fb2;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.aa-seo-cta-button:hover {
    background: #175989;
    color: #fff;
}

.aa-seo-cta-link,
.aa-seo-inline-link {
    color: #1f6fb2;
    font-weight: 600;
    text-decoration: underline;
}

.aa-seo-inline-link:hover {
    color: #164f7a;
}

.aa-seo-inline-banner-300 {
    width: min(300px, 100%);
    max-width: 100%;
}

.aa-seo-inline-banner-left {
    float: left;
    margin: 0.4em 1em 1em 0;
}

.aa-seo-inline-banner-right {
    float: right;
    margin: 0.4em 0 1em 1em;
}

.aa-seo-custom-html-banner iframe,
.aa-seo-custom-html-banner img {
    max-width: 100%;
}

.aa-seo-js-banner {
    min-height: 30px;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .aa-search-section {
        margin-bottom: 20px;
    }
    
    .aa-search-section-header {
        padding: 12px 15px;
    }
    
    .aa-search-section-title {
        font-size: 16px;
    }
    
    .aa-search-item {
        padding: 12px 15px;
    }
    
    .aa-search-item-title {
        font-size: 15px;
    }
    
    .aa-search-item-excerpt {
        font-size: 13px;
    }
    
    .aa-search-item-meta span {
        display: block;
        margin: 4px 0;
    }

    .aa-seo-generated-table {
        min-width: 520px;
    }

    .aa-seo-cta-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .aa-seo-inline-banner-left,
    .aa-seo-inline-banner-right {
        float: none;
        margin: 1em 0;
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .aa-search-results,
    .aa-quality-indicator,
    .aa-content-score {
        display: none;
    }
}
