/* ========================================
   ENTITY INJECTION CARDS
   Phase 3: Frontend Rendering Styles
   ======================================== */

/* Base card styles */
.entity-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin: 24px 0;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.entity-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* ====================
   BUSINESS CARDS
   ==================== */
.business-card .card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.business-card .card-header img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
}

.business-card .card-title h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.business-card .card-category {
    display: inline-block;
    font-size: 13px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 12px;
    border-radius: 12px;
    margin-top: 4px;
}

.business-card .card-body {
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 16px;
}

.business-card .card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.business-card .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
}

.business-card .meta-item .icon {
    font-size: 16px;
}

.business-card .meta-item a {
    color: #2563eb;
    text-decoration: none;
}

.business-card .meta-item a:hover {
    text-decoration: underline;
}

/* ====================
   PRODUCT CARDS
   ==================== */
.product-card {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 20px;
}

.product-card .card-image {
    position: relative;
}

.product-card .card-image img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
}

.product-card .availability-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #10b981;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.product-card .card-body h4 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.product-card .product-brand {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 12px 0;
}

.product-card .product-description {
    font-size: 14px;
    line-height: 1.5;
    color: #4b5563;
    margin-bottom: 12px;
}

.product-card .product-price {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    display: block;
    margin-bottom: 16px;
}

/* ====================
   ACTION BUTTONS
   ==================== */
.card-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.card-actions .btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
}

.card-actions .btn-primary {
    background: #2563eb;
    color: white;
}

.card-actions .btn-primary:hover {
    background: #1d4ed8;
}

.card-actions .btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.card-actions .btn-secondary:hover {
    background: #e5e7eb;
}

.card-actions .btn-directions {
    background: #10b981;
    color: white;
}

.card-actions .btn-directions:hover {
    background: #059669;
}

.card-actions .btn-website {
    background: #3b82f6;
    color: white;
}

.card-actions .btn-website:hover {
    background: #2563eb;
}

.card-actions .btn-call {
    background: #8b5cf6;
    color: white;
}

.card-actions .btn-call:hover {
    background: #7c3aed;
}

/* ====================
   SPECIAL ELEMENTS
   ==================== */
.special-deal {
    margin-top: 16px;
    padding: 12px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
}

.special-deal .deal-badge {
    display: inline-block;
    background: #f59e0b;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.special-deal p {
    margin: 0;
    font-size: 14px;
    color: #92400e;
    font-weight: 500;
}

.sponsored-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #f59e0b;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 0 12px 0 8px;
    text-transform: uppercase;
}

/* ====================
   TEXT MENTIONS
   ==================== */
.entity-card span[itemtype*="LocalBusiness"],
.entity-card span[itemtype*="Product"] {
    display: inline;
}

.entity-card span[itemtype] a {
    color: #2563eb;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px dashed #2563eb;
}

.entity-card span[itemtype] a:hover {
    border-bottom-style: solid;
}

/* ====================
   RESPONSIVE DESIGN
   ==================== */
@media (max-width: 768px) {
    .product-card {
        grid-template-columns: 1fr;
    }
    
    .product-card .card-image img {
        height: 200px;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .card-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .business-card .card-header {
        flex-direction: column;
        text-align: center;
    }
}

/* ====================
   SIDEBAR WIDGETS
   ==================== */
.article-sidebar .entity-card {
    margin: 16px 0;
    padding: 16px;
}

.article-sidebar .business-card .card-header img {
    width: 48px;
    height: 48px;
}

.article-sidebar .product-card {
    grid-template-columns: 1fr;
}

.article-sidebar .card-actions .btn {
    font-size: 12px;
    padding: 8px 16px;
}

/* ====================
   PRINT STYLES
   ==================== */
@media print {
    .entity-card {
        border: 1px solid #ccc;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .card-actions {
        display: none;
    }
    
    .sponsored-badge {
        background: #999;
    }
}

/* ====================
   DARK MODE SUPPORT
   ==================== */
@media (prefers-color-scheme: dark) {
    .entity-card {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .business-card .card-title h4,
    .product-card .card-body h4 {
        color: #f9fafb;
    }
    
    .business-card .card-body,
    .product-card .product-description {
        color: #d1d5db;
    }
    
    .business-card .card-category {
        background: #374151;
        color: #9ca3af;
    }
    
    .business-card .card-meta {
        border-top-color: #374151;
    }
    
    .card-actions .btn-secondary {
        background: #374151;
        color: #f9fafb;
    }
    
    .card-actions .btn-secondary:hover {
        background: #4b5563;
    }
}

/* ====================
   ACCESSIBILITY
   ==================== */
.entity-card:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.card-actions .btn:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .entity-card {
        transition: none;
    }
    
    .card-actions .btn {
        transition: none;
    }
}
