/**
 * Frontend Styles for HivePress SEO Pro
 *
 * @package HivePress_SEO_Pro
 */

/* Development mode - structured data visualization */
.hivepress-seo-pro-debug {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    z-index: 9999;
    max-width: 300px;
}

.hivepress-seo-pro-debug h4 {
    margin: 0 0 5px 0;
    color: #72aee6;
}

.hivepress-seo-pro-debug ul {
    margin: 0;
    padding-left: 15px;
}

.hivepress-seo-pro-debug li {
    margin-bottom: 2px;
}

/* Schema validation indicators (debug mode only) */
.schema-validation-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 1000;
}

.schema-validation-indicator.valid {
    background: #00a32a;
}

.schema-validation-indicator.invalid {
    background: #d63638;
}

.schema-validation-indicator.warning {
    background: #dba617;
}

/* Structured data testing helper (only visible in debug mode) */
.structured-data-test-helper {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 2px solid #2271b1;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.structured-data-test-helper.active {
    display: block;
}

.structured-data-test-helper h3 {
    margin-top: 0;
    color: #2271b1;
}

.structured-data-test-helper .close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

.structured-data-test-helper .schema-preview {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
}

.structured-data-test-helper .schema-preview pre {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    overflow-x: auto;
}

.structured-data-test-helper .validation-results {
    margin: 15px 0;
}

.structured-data-test-helper .validation-error {
    color: #d63638;
    margin: 5px 0;
}

.structured-data-test-helper .validation-warning {
    color: #dba617;
    margin: 5px 0;
}

.structured-data-test-helper .validation-success {
    color: #00a32a;
    margin: 5px 0;
}

/* SEO enhancement indicators (visible to logged-in users) */
.seo-enhancement-notice {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 4px;
    padding: 10px 15px;
    margin: 15px 0;
    font-size: 14px;
}

.seo-enhancement-notice.hidden {
    display: none;
}

.seo-enhancement-notice h4 {
    margin: 0 0 8px 0;
    color: #2271b1;
}

.seo-enhancement-notice ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.seo-enhancement-notice li {
    margin-bottom: 4px;
}

/* Schema property hints (admin only) */
.schema-property-hint {
    position: relative;
    display: inline-block;
}

.schema-property-hint::after {
    content: '📊';
    position: absolute;
    top: -5px;
    right: -15px;
    font-size: 12px;
    opacity: 0.6;
}

.schema-property-hint:hover::before {
    content: attr(data-schema-property);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1d2327;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

/* Rich snippets preview (for testing) */
.rich-snippet-preview {
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    background: white;
    font-family: Arial, sans-serif;
}

.rich-snippet-preview .business-name {
    color: #1a0dab;
    font-size: 20px;
    line-height: 1.3;
    text-decoration: none;
    margin-bottom: 4px;
    display: block;
}

.rich-snippet-preview .business-url {
    color: #006621;
    font-size: 14px;
    margin-bottom: 8px;
}

.rich-snippet-preview .business-description {
    color: #4d5156;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 12px;
}

.rich-snippet-preview .business-details {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #70757a;
}

.rich-snippet-preview .business-detail {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rich-snippet-preview .business-detail::before {
    content: '•';
    color: #dadce0;
}

.rich-snippet-preview .business-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rich-snippet-preview .stars {
    color: #fbbc04;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print styles */
@media print {
    .hivepress-seo-pro-debug,
    .structured-data-test-helper,
    .seo-enhancement-notice,
    .schema-property-hint::after {
        display: none !important;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .hivepress-seo-pro-debug {
        position: static;
        margin: 10px;
        max-width: none;
    }
    
    .structured-data-test-helper {
        margin: 10px;
        max-width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
    }
    
    .rich-snippet-preview .business-details {
        flex-direction: column;
        gap: 8px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .rich-snippet-preview {
        background: #202124;
        border-color: #3c4043;
    }
    
    .rich-snippet-preview .business-name {
        color: #8ab4f8;
    }
    
    .rich-snippet-preview .business-url {
        color: #99c794;
    }
    
    .rich-snippet-preview .business-description {
        color: #bdc1c6;
    }
    
    .rich-snippet-preview .business-details {
        color: #9aa0a6;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .hivepress-seo-pro-debug {
        background: black;
        color: white;
        border: 2px solid white;
    }
    
    .seo-enhancement-notice {
        background: white;
        border: 2px solid black;
        color: black;
    }
    
    .schema-validation-indicator.valid {
        background: #00ff00;
    }
    
    .schema-validation-indicator.invalid {
        background: #ff0000;
    }
    
    .schema-validation-indicator.warning {
        background: #ffff00;
    }
}

/* Animation for loading states */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading-schema {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Utility classes */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.visually-hidden {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    padding: 0 !important;
    border: 0 !important;
    height: 1px !important;
    width: 1px !important;
    overflow: hidden;
}
