/**
 * SEO Validator Styles
 * 
 * Styles for SEO field validation and social media previews
 */

/* Field Validator */
.seo-validator {
    margin-top: 8px !important;
}

.seo-validator-content {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.seo-progress-bar {
    position: relative;
    overflow: hidden;
}

.seo-progress-fill {
    transition: width 0.3s ease, background 0.3s ease;
}

/* Social Previews Container */
.seo-social-previews {
    margin-top: 30px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Preview Section Hover Effects */
.preview-section {
    transition: transform 0.2s ease;
}

.preview-section:hover {
    transform: translateX(2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .seo-social-previews {
        padding: 15px;
    }
    
    .preview-section > div {
        max-width: 100% !important;
    }
}

/* Character Counter Badge */
.seo-char-counter {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.seo-char-counter.optimal {
    background: #e8f5e9;
    color: #2e7d32;
}

.seo-char-counter.good {
    background: #fff3e0;
    color: #f57c00;
}

.seo-char-counter.warning {
    background: #fff3e0;
    color: #f57c00;
}

.seo-char-counter.error {
    background: #ffebee;
    color: #c62828;
}

/* Field Labels Enhancement */
.field[data-attribute*="seo"] label,
.field[id*="seo"] label {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Success Animation */
.seo-validator.optimal .seo-progress-fill {
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Warning Pulse */
.seo-validator.error .seo-validator-content {
    animation: warningShake 0.5s ease;
}

@keyframes warningShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* Preview Card Shadows */
.preview-section > div > div {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.preview-section > div > div:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Loading State */
.seo-preview-loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.seo-preview-loading::after {
    content: '...';
    animation: ellipsis 1.5s infinite;
}

@keyframes ellipsis {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* Accessibility */
.seo-validator-content:focus-within {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

/* Dark Mode Support (if Craft supports it) */
@media (prefers-color-scheme: dark) {
    .seo-validator-content {
        background: #2a2a2a !important;
        color: #e0e0e0 !important;
    }
    
    .seo-social-previews > div {
        background: #1e1e1e !important;
        border-color: #444 !important;
    }
}
