/**
 * XML Feed Validator - Public Styles
 * 
 * Styles til frontend shortcode visning
 */

.xfval-container {
    max-width: 800px;
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.xfval-title {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.xfval-form {
    margin-bottom: 30px;
}

.xfval-form-group {
    margin-bottom: 15px;
}

.xfval-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.xfval-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.xfval-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.xfval-button {
    background-color: #0073aa;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.xfval-button:hover {
    background-color: #005a87;
}

.xfval-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.xfval-loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #666;
}

.xfval-loading.active {
    display: block;
}

.xfval-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: xfval-spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes xfval-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.xfval-results {
    display: none;
    margin-top: 30px;
}

.xfval-results.active {
    display: block;
}

.xfval-section {
    margin-bottom: 25px;
    padding: 15px;
    border-radius: 6px;
    background-color: white;
    border-left: 4px solid #0073aa;
}

.xfval-section-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.xfval-validation {
    border-left-color: #46b450;
}

.xfval-validation.invalid {
    border-left-color: #dc3232;
}

.xfval-analysis {
    border-left-color: #ffb900;
}

.xfval-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.xfval-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.xfval-list li:last-child {
    border-bottom: none;
}

.xfval-error {
    color: #dc3232;
    font-weight: 500;
}

.xfval-warning {
    color: #ffb900;
    font-weight: 500;
}

.xfval-success {
    color: #46b450;
    font-weight: 500;
}

.xfval-info {
    color: #0073aa;
}

.xfval-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.xfval-stat {
    text-align: center;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 4px;
}

.xfval-stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #0073aa;
}

.xfval-stat-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.xfval-elements {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background-color: #fafafa;
}

.xfval-element {
    font-family: monospace;
    font-size: 14px;
    padding: 2px 0;
    color: #333;
}

.xfval-error-message {
    background-color: #ffeaea;
    border: 1px solid #dc3232;
    color: #dc3232;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
}

.xfval-examples {
    margin-top: 20px;
    padding: 15px;
    background-color: #e8f4f8;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
}

.xfval-examples h4 {
    margin: 0 0 10px 0;
    color: #0073aa;
}

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

.xfval-examples li {
    margin-bottom: 5px;
    font-family: monospace;
    font-size: 14px;
}

/* Responsive design */
@media (max-width: 768px) {
    .xfval-container {
        margin: 10px 0;
        padding: 15px;
    }
    
    .xfval-stats {
        grid-template-columns: 1fr;
    }
    
    .xfval-input,
    .xfval-button {
        font-size: 16px; /* Forhindre zoom på iOS */
    }
}



/* Hierarkisk struktur styling */
.xfval-hierarchy {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    max-height: 500px;
    overflow-y: auto;
}

.xfval-hierarchy-item {
    margin-bottom: 5px;
}

.xfval-hierarchy-header {
    display: flex;
    align-items: center;
    padding: 3px 0;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.xfval-hierarchy-header:hover {
    background-color: rgba(0, 115, 170, 0.1);
}

.xfval-hierarchy-toggle {
    background: none;
    border: none;
    color: #0073aa;
    cursor: pointer;
    font-size: 12px;
    width: 20px;
    text-align: center;
    margin-right: 5px;
    padding: 0;
}

.xfval-hierarchy-toggle:hover {
    background-color: rgba(0, 115, 170, 0.2);
    border-radius: 3px;
}

.xfval-hierarchy-spacer {
    width: 20px;
    margin-right: 5px;
}

.xfval-hierarchy-element {
    flex: 1;
    color: #333;
}

.xfval-hierarchy-children {
    margin-left: 25px;
    border-left: 1px dotted #ccc;
    padding-left: 10px;
}

/* Attribut styling */
.xfval-attribute {
    color: #d73502;
    margin-left: 5px;
}

.xfval-attr-name {
    color: #d73502;
    font-weight: 600;
}

.xfval-attr-value {
    color: #032f62;
}

.xfval-attr-ns {
    color: #6f42c1;
    font-size: 11px;
    font-style: italic;
}

.xfval-count {
    color: #28a745;
    font-weight: bold;
    margin-left: 5px;
}

.xfval-text-indicator {
    margin-left: 5px;
    font-size: 12px;
}

.xfval-text-sample {
    margin-left: 25px;
    color: #6c757d;
    font-style: italic;
    font-size: 12px;
    padding: 2px 0;
}

/* Attribut variationer */
.xfval-attribute-variations {
    margin-left: 25px;
    margin-top: 5px;
    padding: 8px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    font-size: 12px;
}

.xfval-variation-section {
    margin-bottom: 5px;
}

.xfval-variation-section:last-child {
    margin-bottom: 0;
}

.xfval-common-attr {
    color: #28a745;
    font-weight: 600;
}

.xfval-optional-attr {
    color: #ffc107;
    font-weight: 600;
}

/* Attribut struktur analyse */
.xfval-attribute-structure {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.xfval-attr-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.xfval-attr-stat {
    text-align: center;
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 4px;
}

.xfval-attr-frequency {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 5px;
    margin-bottom: 15px;
}

.xfval-freq-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    font-family: monospace;
    font-size: 13px;
}

.xfval-freq-name {
    color: #0073aa;
    font-weight: 600;
}

.xfval-freq-count {
    color: #6c757d;
}

.xfval-namespace-attrs {
    margin-bottom: 15px;
}

.xfval-ns-group {
    padding: 8px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 5px;
    font-family: monospace;
    font-size: 13px;
}

.xfval-attr-patterns {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
}

.xfval-pattern-group {
    margin-bottom: 8px;
    padding: 5px;
    background-color: #f8f9fa;
    border-radius: 3px;
    font-family: monospace;
    font-size: 13px;
}

.xfval-pattern-group:last-child {
    margin-bottom: 0;
}

/* Responsive design for hierarchy */
@media (max-width: 768px) {
    .xfval-hierarchy {
        font-size: 12px;
        padding: 10px;
    }
    
    .xfval-hierarchy-children {
        margin-left: 15px;
        padding-left: 5px;
    }
    
    .xfval-attr-stats {
        grid-template-columns: 1fr;
    }
    
    .xfval-attr-frequency {
        grid-template-columns: 1fr;
    }
    
    .xfval-attribute {
        display: block;
        margin-left: 0;
        margin-top: 3px;
        padding-left: 20px;
    }
}



/* Tekst indhold styling */
.xfval-text-content {
    color: #28a745;
    font-weight: normal;
    font-style: italic;
    margin-left: 5px;
    background-color: rgba(40, 167, 69, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

/* Afsluttende tag styling */
.xfval-hierarchy-closing {
    margin-top: 2px;
    opacity: 0.7;
}

.xfval-hierarchy-closing .xfval-hierarchy-element {
    color: #6c757d;
    font-size: 13px;
}

/* Forbedret namespace element styling */
.xfval-hierarchy-element {
    line-height: 1.4;
}

/* Namespace prefix styling */
.xfval-hierarchy-element:contains("g:"),
.xfval-hierarchy-element:contains("xmlns:") {
    color: #6f42c1;
}

/* Specifik styling for Google Shopping namespace */
span:contains("g:") {
    color: #6f42c1;
    font-weight: 600;
}

/* Forbedret responsive design for namespace elementer */
@media (max-width: 768px) {
    .xfval-text-content {
        display: block;
        margin-left: 0;
        margin-top: 5px;
        font-size: 12px;
    }
    
    .xfval-hierarchy-closing {
        margin-left: 15px;
    }
}

/* Hover effekter for bedre interaktivitet */
.xfval-hierarchy-item:hover > .xfval-hierarchy-header {
    background-color: rgba(0, 115, 170, 0.05);
}

.xfval-hierarchy-item:hover > .xfval-hierarchy-closing {
    opacity: 1;
}

/* Styling for namespace-prefixed elementer */
.xfval-namespace-element {
    color: #6f42c1;
    font-weight: 600;
}

/* Bedre visuel adskillelse af niveauer */
.xfval-hierarchy-children {
    position: relative;
}

.xfval-hierarchy-children::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #dee2e6;
}

/* Styling for elementer med tekst indhold */
.xfval-hierarchy-item[data-has-text="true"] {
    background-color: rgba(40, 167, 69, 0.02);
    border-left: 2px solid rgba(40, 167, 69, 0.3);
    padding-left: 8px;
    margin-left: -10px;
}


/* Google Shopping validering styling */
.xfval-google-shopping {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

.xfval-compliance-score {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.xfval-score-label {
    font-weight: 600;
    color: #495057;
}

.xfval-score-value {
    font-size: 1.2em;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 4px;
}

.score-excellent {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.score-good {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.score-fair {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.score-poor {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Error og recommendation lister */
.xfval-error-list {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 15px;
    margin: 10px 0;
}

.xfval-error-list li {
    color: #721c24;
    margin-bottom: 8px;
}

.xfval-recommendation-list {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    padding: 15px;
    margin: 10px 0;
}

.xfval-recommendation-list li {
    color: #0c5460;
    margin-bottom: 8px;
}

/* URL validering styling */
.xfval-url-validation {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

/* Content kvalitet styling */
.xfval-content-quality {
    background: #f0f8f0;
    border: 1px solid #c3e6c3;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

/* SEO analyse styling */
.xfval-seo-analysis {
    background: #fff8e1;
    border: 1px solid #ffecb3;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

/* Forbedret stats grid */
.xfval-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.xfval-stat {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.xfval-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.xfval-stat-value {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: #007cba;
    margin-bottom: 5px;
}

.xfval-stat-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

/* Responsive forbedringer */
@media (max-width: 768px) {
    .xfval-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .xfval-compliance-score {
        flex-direction: column;
        text-align: center;
    }
    
    .xfval-google-shopping,
    .xfval-url-validation,
    .xfval-content-quality,
    .xfval-seo-analysis {
        padding: 15px;
    }
}

