/* Entity Recognition System - Frontend Styles */

/* Hide default WordPress page title for entity pages */
.page .entry-title,
.page .page-title,
.page h1.title,
.page header .entry-header h1 {
    display: none !important;
}

.ers-matched-entities {
    margin-top: 40px;
    padding: 30px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    clear: both;
}

.ers-matched-entities .ers-title {
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    border-bottom: 3px solid #0073aa;
}

.ers-entities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.ers-entity-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ers-entity-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.ers-entity-image {
    display: block;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f0f0f0;
}

.ers-entity-image.ers-no-entity-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ers-entity-placeholder-icon {
    font-size: 64px;
    opacity: 0.8;
}

.ers-entity-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ers-entity-card:hover .ers-entity-image img {
    transform: scale(1.05);
}

.ers-entity-content {
    padding: 20px;
}

.ers-entity-type {
    display: inline-block;
    padding: 4px 12px;
    background: #0073aa;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 3px;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.ers-entity-name {
    margin: 10px 0;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    line-height: 1.3;
}

.ers-entity-name a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ers-entity-name a:hover {
    color: #005177;
    text-decoration: underline;
}

.ers-entity-country {
    margin: 8px 0 12px 0;
    font-size: 13px;
    color: #0073aa;
    font-weight: 600;
}

.ers-entity-description {
    margin: 12px 0;
    font-size: 14px;
    line-height: 1.6;
}

.ers-entity-link {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.ers-entity-link:hover {
    background: #005177;
    color: #fff;
    text-decoration: none;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .ers-matched-entities {
        padding: 20px;
    }
    
    .ers-matched-entities .ers-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .ers-entities-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ers-entity-image {
        height: 150px;
    }
}

@media screen and (max-width: 480px) {
    .ers-matched-entities {
        padding: 15px;
        margin-top: 30px;
    }
    
    .ers-entity-content {
        padding: 15px;
    }
    
    .ers-entity-name {
        font-size: 18px;
    }
}

/* Alternative Layout: List View (can be enabled via settings in future) */
.ers-matched-entities.ers-list-view .ers-entities-grid {
    grid-template-columns: 1fr;
}

.ers-matched-entities.ers-list-view .ers-entity-card {
    display: flex;
    flex-direction: row;
}

.ers-matched-entities.ers-list-view .ers-entity-image {
    width: 200px;
    height: auto;
    min-height: 150px;
}

.ers-matched-entities.ers-list-view .ers-entity-content {
    flex: 1;
}

/* Print Styles */
@media print {
    .ers-matched-entities {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    .ers-entity-card {
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .ers-entity-link {
        display: none;
    }
}

/* Entity Page Styles */
.ers-entity-page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.ers-entity-page-title {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: white;
}

.ers-entity-page-info .ers-entity-type {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.ers-entity-page-info .ers-entity-country {
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    margin: 15px 0 0 0;
}

/* Custom Fields Section */
.ers-entity-custom-fields {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.ers-entity-custom-fields .ers-field-item {
    margin: 10px 0;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
}

.ers-entity-custom-fields .ers-field-item strong {
    color: rgba(255, 255, 255, 1);
    font-weight: 600;
    margin-right: 8px;
}

/* Entity Description inside purple box */
.ers-entity-description {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.ers-entity-description div {
    margin-top: 15px;
}

.ers-entity-description p {
    font-size: 16px;
    line-height: 1.8;
    margin: 0 0 15px 0;
}

.ers-entity-description p:last-child {
    margin-bottom: 0;
}

.ers-entity-description strong {
    color: rgba(255, 255, 255, 1);
    font-weight: 700;
}

.ers-entity-description em {
    font-style: italic;
}

.ers-entity-description ul,
.ers-entity-description ol {
    margin: 15px 0;
    padding-left: 30px;
    color: rgba(255, 255, 255, 0.9);
}

.ers-entity-description li {
    margin: 8px 0;
    line-height: 1.6;
}

.ers-entity-description a {
    color: rgba(255, 255, 255, 1);
    text-decoration: underline;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.ers-entity-description a:hover {
    opacity: 0.8;
}

/* About Section - No longer used */
.ers-about-section {
    display: none;
}

/* Entry Image Section */
.ers-entry-image-section {
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.ers-entry-image-section img {
    width: 100%;
    height: auto;
    display: block;
}

/* Related Posts Section */
.ers-related-posts {
    margin: 40px 0;
    padding: 40px 0;
    border-top: 2px solid #e5e5e5;
}

.ers-related-posts h3 {
    font-size: 28px;
    color: #2c3e50;
    margin: 0 0 30px 0;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.ers-related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 25px;
}

.ers-related-post-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;

    display: flex;
    flex-direction: column;
}

.ers-related-post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.ers-related-post-thumbnail {
    display: block;
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.ers-related-post-thumbnail.ers-no-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ers-placeholder-icon {
    font-size: 48px;
    opacity: 0.8;
}

.ers-related-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ers-related-post-item:hover .ers-related-post-thumbnail img {
    transform: scale(1.1);
}

.ers-related-post-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ers-related-post-content h4 {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
}

.ers-related-post-content h4 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ers-related-post-content h4 a:hover {
    color: #667eea;
}

.ers-related-post-excerpt {
    display: none;
}

.ers-read-more {
    display: inline-block;
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ers-read-more:hover {
    color: #764ba2;
    transform: translateX(5px);
}

/* Responsive adjustments for entity pages */
@media (max-width: 768px) {
    .ers-entity-page-header {
        flex-direction: column;
        padding: 30px 20px;
        text-align: center;
    }
    
    .ers-entity-page-image img {
        width: 150px;
        height: 150px;
    }
    
    .ers-related-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* Custom Fields Display */
.ers-entity-custom-fields {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.ers-entity-custom-fields .ers-field-item {
    margin: 12px 0;
    font-size: 16px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.95);
}

.ers-entity-custom-fields .ers-field-item strong {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ers-entity-custom-fields .ers-field-item a {
    color: #ffd700;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
}

.ers-entity-custom-fields .ers-field-item a:hover {
    color: #ffed4e;
    border-bottom-color: #ffed4e;
}

/* Age Display Styling */
.ers-age-display {
    color: #4dffff;
    font-weight: 700;
    font-style: normal;
    background: rgba(77, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    border-left: 3px solid #4dffff;
    margin-left: 8px;
    display: inline-block;
}
