/**
 * Location Display CSS
 * 
 * Styling for location cards, category badges, SVG icons, and single location pages
 * 
 * @package LocationSearchPlugin
 */

/* Category Badge Styling */
.lsp-card-categories,
.lsp-header-categories {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.lsp-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: #6b7280;
    transition: all 0.2s ease;
}

.lsp-category-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Category Type Specific Colors */
.lsp-badge-tipologia {
    background: #2563eb;
    color: white;
}

.lsp-badge-area {
    background: #059669;
    color: white;
}

.lsp-badge-stile {
    background: #7c3aed;
    color: white;
}

.lsp-category-primary {
    font-size: 14px;
    padding: 6px 16px;
    background: #dc2626;
}

.lsp-category-area {
    background: #059669;
}

.lsp-category-stile {
    background: #7c3aed;
}

/* Category Badge in Cards */
.lsp-card-badge.lsp-badge-tipologia,
.lsp-card-badge.lsp-badge-area,
.lsp-card-badge.lsp-badge-stile {
    background: #4b5563;
    color: white;
    margin-bottom: 8px;
}

.lsp-card-badge.lsp-badge-tipologia {
    background: #3b82f6;
}

.lsp-card-badge.lsp-badge-area {
    background: #10b981;
}

.lsp-card-badge.lsp-badge-stile {
    background: #8b5cf6;
}

/* SVG Icon Styling */
.lsp-icon {
    display: inline-block;
    vertical-align: middle;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.2s ease;
}

.lsp-icon-small {
    width: 16px;
    height: 16px;
}

.lsp-icon-medium {
    width: 24px;
    height: 24px;
}

.lsp-icon-large {
    width: 32px;
    height: 32px;
}

.lsp-icon-xlarge {
    width: 48px;
    height: 48px;
}

/* Icon hover effects */
.lsp-icon:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

/* Icon in cards */
.lsp-location-card .lsp-icon {
    margin-right: 6px;
    color: #2563eb;
}

.lsp-location-card .lsp-icon-medium {
    margin-right: 8px;
}

.lsp-location-card .lsp-icon-large {
    margin-right: 12px;
}

/* Icon in single location header */
.lsp-single-header .lsp-icon {
    color: #dc2626;
    margin-right: 8px;
}

/* Category Icon Overlay */
.lsp-card-category-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
    transition: all 0.2s ease;
}

.lsp-card-category-overlay:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 1);
}

.lsp-card-category-overlay .lsp-icon {
    color: #dc2626;
    margin: 0;
}

/* Location Card Enhancements */
.lsp-location-card {
    position: relative;
    transition: all 0.3s ease;
}

.lsp-location-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.lsp-card-image-wrapper {
    position: relative;
    overflow: hidden;
}

/* Single Location Page Enhancements */
.lsp-single-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 24px 0;
}

.lsp-header-categories {
    background: rgba(255, 255, 255, 0.8);
    padding: 12px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

/* Admin Only Section */
.lsp-admin-only {
    background: #fef3c7;
    border: 2px dashed #f59e0b;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.lsp-admin-only h4 {
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 18px;
}

.lsp-admin-attributes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.lsp-admin-attribute {
    background: rgba(255, 255, 255, 0.6);
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
}

.lsp-admin-label {
    font-weight: 600;
    color: #92400e;
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.lsp-admin-value {
    color: #1f2937;
    font-weight: 500;
    font-size: 15px;
}

.lsp-empty-attributes {
    color: #6b7280;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Taxonomy Section Enhancements */
.lsp-tax-group {
    margin-bottom: 24px;
}

.lsp-tax-group h4 {
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.lsp-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lsp-tag {
    background: #f3f4f6;
    color: #374151;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.lsp-tag:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.lsp-empty {
    color: #9ca3af;
    font-style: italic;
}

/* Features Grid Enhancements */
.lsp-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.lsp-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.lsp-feature-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.lsp-feature-item i {
    color: #2563eb;
    font-size: 18px;
}

.lsp-feature-item span {
    font-size: 14px;
    color: #374151;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .lsp-card-categories,
    .lsp-header-categories {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .lsp-category-badge {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .lsp-category-primary {
        font-size: 12px;
        padding: 4px 12px;
    }
    
    .lsp-card-category-overlay {
        width: 40px;
        height: 40px;
        top: 8px;
        left: 8px;
    }
    
    .lsp-card-category-overlay .lsp-icon {
        width: 20px;
        height: 20px;
    }
    
    .lsp-admin-attributes-grid {
        grid-template-columns: 1fr;
    }
    
    .lsp-features-grid {
        grid-template-columns: 1fr;
    }
    
    .lsp-header-categories {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .lsp-tax-group {
        margin-bottom: 16px;
    }
    
    .lsp-feature-item {
        padding: 8px;
    }
    
    .lsp-admin-only {
        padding: 16px;
        margin: 16px 0;
    }
    
    .lsp-admin-attribute {
        padding: 8px;
    }
}

/* Loading States */
.lsp-location-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.lsp-location-card.loading .lsp-card-image {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Accessibility Enhancements */
.lsp-icon:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.lsp-category-badge:focus,
.lsp-tag:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

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

/* Print Optimization */
@media print {
    .lsp-admin-only {
        display: none !important;
    }
    
    .lsp-favorite-btn,
    .lsp-contact-form-wrapper {
        display: none !important;
    }
    
    .lsp-location-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
    
    .lsp-icon {
        color: #000 !important;
    }
}

/* Color Contrast Improvements */
@media (prefers-contrast: high) {
    .lsp-category-badge,
    .lsp-tag {
        border: 2px solid currentColor;
    }
    
    .lsp-card-category-overlay {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .lsp-location-card,
    .lsp-category-badge,
    .lsp-icon,
    .lsp-card-category-overlay,
    .lsp-feature-item,
    .lsp-tag {
        transition: none;
    }
    
    .lsp-location-card:hover {
        transform: none;
    }
}