/* Widen DAM Integration Frontend Styles */

.widen-asset {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.widen-asset:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.widen-thumbnail {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.widen-asset-info {
    padding: 1rem;
}

.widen-asset-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.widen-asset-description {
    margin: 0 0 1rem 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.widen-download-btn {
    display: inline-block;
    background: #0073aa;
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.widen-download-btn:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.widen-collection {
    margin-bottom: 2rem;
}

.widen-collection-title {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 0.5rem;
}

.widen-collection-description {
    margin: 0 0 1.5rem 0;
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
}

.widen-assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.widen-search-results {
    margin-bottom: 2rem;
}

.widen-search-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 0.5rem;
}

.widen-no-results {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.widen-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.widen-notice {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .widen-assets-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .widen-asset-info {
        padding: 0.75rem;
    }
    
    .widen-asset-name {
        font-size: 1rem;
    }
    
    .widen-collection-title,
    .widen-search-title {
        font-size: 1.3rem;
    }
}

/* Loading states */
.widen-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.widen-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    border-top-color: #0073aa;
    animation: spin 1s ease-in-out infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Asset type indicators */
.widen-asset-type {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.widen-asset-type.image { background: #d4edda; color: #155724; }
.widen-asset-type.video { background: #cce5ff; color: #004085; }
.widen-asset-type.document { background: #fff3cd; color: #856404; }
.widen-asset-type.audio { background: #f8d7da; color: #721c24; }

/* Collection asset specific styles */
.widen-collection-asset {
    margin-bottom: 0;
}

.widen-search-asset {
    margin-bottom: 0;
}

/* Enhanced hover effects */
.widen-asset:hover .widen-thumbnail {
    filter: brightness(1.05);
}

.widen-asset:hover .widen-asset-name {
    color: #0073aa;
}

/* Accessibility improvements */
.widen-download-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.widen-asset:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* API Testing Styles */
.widen-api-test-progress {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.widen-api-test-progress h3 {
    margin: 0 0 1rem 0;
    color: #495057;
}

.endpoint-test {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    border-left: 4px solid #6c757d;
}

.endpoint-success {
    color: #28a745;
    font-weight: 600;
}

.endpoint-failed {
    color: #dc3545;
    font-weight: 600;
}

.widen-debug-info {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.widen-debug-info h4 {
    margin: 0 0 1rem 0;
    color: #004085;
}

.widen-debug-info ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.widen-debug-info li {
    margin: 0.25rem 0;
}
