/* Navigation Clusters Styles */
.navigation-clusters {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.5rem 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.navigation-clusters--compact {
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.cluster-group {
    margin-bottom: 1.5rem;
}

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

.navigation-clusters--compact .cluster-group {
    margin-bottom: 1rem;
}

.cluster-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.navigation-clusters--compact .cluster-title {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #e2e8f0;
}

.cluster-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #3b82f6;
}

/* Cluster Items Container */
.cluster-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.5rem;
}

.cluster-items--compact {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.cluster-items--categories {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.cluster-items--regions {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
}

.navigation-clusters--compact .cluster-items {
    gap: 0.375rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.navigation-clusters--compact .cluster-items--compact {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

/* Individual Cluster Items */
.cluster-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.navigation-clusters--compact .cluster-item {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    border-radius: 0.5rem;
}

.cluster-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px 0 rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
    color: #1e293b;
    text-decoration: none;
}

.cluster-item:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Cluster Item Icons */
.cluster-item__icon {
    flex-shrink: 0;
    font-size: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.navigation-clusters--compact .cluster-item__icon {
    font-size: 1rem;
    width: 1.75rem;
    height: 1.75rem;
}

/* Cluster Item Content */
.cluster-item__content {
    flex: 1;
    min-width: 0;
}

.cluster-item__title {
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.25;
    color: #1e293b;
    display: block;
    margin-bottom: 0.125rem;
}

.cluster-item__count {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1;
}

.cluster-item__subtitle {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.2;
}

.navigation-clusters--compact .cluster-item__title {
    font-size: 0.75rem;
    margin-bottom: 0;
}

.navigation-clusters--compact .cluster-item__count {
    font-size: 0.6875rem;
}

.navigation-clusters--compact .cluster-item__subtitle {
    font-size: 0.6875rem;
}

/* Specific Item Types */
.specialty-item:hover {
    border-color: #10b981;
    box-shadow: 0 4px 12px 0 rgba(16, 185, 129, 0.15);
}

.specialty-item:hover .cluster-item__icon {
    background: linear-gradient(135deg, #dcfdf7 0%, #a7f3d0 100%);
}

.location-item:hover {
    border-color: #f59e0b;
    box-shadow: 0 4px 12px 0 rgba(245, 158, 11, 0.15);
}

.location-item:hover .cluster-item__icon {
    background: linear-gradient(135deg, #fefbeb 0%, #fde68a 100%);
}

.region-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px 0 rgba(59, 130, 246, 0.15);
}

.region-item:hover .cluster-item__icon {
    background: linear-gradient(135deg, #eff6ff 0%, #bfdbfe 100%);
}

/* Compact styles for regions */
.cluster-items--regions .cluster-item {
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
}

.cluster-items--regions .cluster-item__icon {
    width: 2rem;
    height: 2rem;
    font-size: 1.25rem;
    border-radius: 0.375rem;
}

.cluster-items--regions .cluster-item__title {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.125rem;
}

.cluster-items--regions .cluster-item__subtitle {
    font-size: 0.7rem;
    margin-bottom: 0.125rem;
}

.cluster-items--regions .cluster-item__count {
    font-size: 0.7rem;
    font-weight: 500;
}

.filter-item:hover {
    border-color: #8b5cf6;
    box-shadow: 0 4px 12px 0 rgba(139, 92, 246, 0.15);
}

.filter-item:hover .cluster-item__icon {
    background: linear-gradient(135deg, #faf5ff 0%, #ddd6fe 100%);
}

.category-item:hover {
    border-color: #ef4444;
    box-shadow: 0 4px 12px 0 rgba(239, 68, 68, 0.15);
}

.category-item:hover .cluster-item__icon {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

/* More Items */
.cluster-item--more {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
}

.cluster-item--more:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px 0 rgba(59, 130, 246, 0.25);
}

.cluster-item--more .cluster-item__title,
.cluster-item--more .cluster-item__count {
    color: white;
}

.cluster-item--more .cluster-item__icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navigation-clusters {
        padding: 1.5rem 0;
    }
    
    .cluster-items {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .cluster-items--compact {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cluster-items--categories {
        grid-template-columns: 1fr;
    }
    
    .cluster-items--regions {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.375rem;
    }
    
    .cluster-item {
        padding: 0.75rem 0.875rem;
    }
    
    .cluster-item__icon {
        width: 2rem;
        height: 2rem;
        font-size: 1.25rem;
    }
    
    .cluster-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .cluster-group {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .cluster-items--compact {
        grid-template-columns: 1fr;
    }
    
    .cluster-items--regions {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.25rem;
    }
    
    .cluster-items--regions .cluster-item {
        padding: 0.5rem 0.625rem;
    }
    
    .cluster-items--regions .cluster-item__icon {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 1.125rem;
    }
    
    .cluster-items--regions .cluster-item__title {
        font-size: 0.75rem;
    }
    
    .cluster-items--regions .cluster-item__subtitle,
    .cluster-items--regions .cluster-item__count {
        font-size: 0.65rem;
    }
    
    .cluster-item {
        padding: 0.625rem 0.75rem;
        gap: 0.5rem;
    }
}

/* Enhanced Visual Effects */
.cluster-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #3b82f6 50%, transparent 100%);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.cluster-item:hover::before {
    transform: scaleX(1);
}

/* Accessibility Improvements */
.cluster-item:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-color: #3b82f6;
}

@media (prefers-reduced-motion: reduce) {
    .cluster-item {
        transition: none;
    }
    
    .cluster-item:hover {
        transform: none;
    }
    
    .cluster-item::before {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cluster-item {
        border: 2px solid;
        background: white;
    }
    
    .cluster-item:hover {
        background: #f8fafc;
    }
}

/* Loading Animation for Dynamic Content */
.cluster-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.cluster-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 1rem;
    height: 1rem;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Print Styles */
@media print {
    .navigation-clusters {
        display: none;
    }
}